Part Number Hot Search : 
IPD60 7C42X1V 230002B CD5546B 91000 1100T OTR610 PKN030CA
Product Description
Full Text Search
 

To Download MC68HC11P0CFN3 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  m68hc11 microcontrollers mc68hc11p2/d r e v . 1, 4 / 20 0 2 mc68hc11p2 technical data mc68hc711p2 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc11p2 ? rev 1.0 technical data mc68hc11p2 mc68hc711p2 technical data ? rev 1.0 motorola reserves the right to make changes without further notice to any products herein. motorola makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does motorola assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. "typical" parameters which may be provided in motorola data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. all operating parameters, including "typicals" must be validated for each customer application by customer?s technical experts. motorola does not convey any license under its patent rights nor the rights of others. motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the motorola product could create a situation where personal injury or death may occur. should buyer purchase or use motorola products for any such unintended or unauthorized application, buyer shall indemnify and hold motorola and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that motorola was negligent regarding the design or manufacture of the part. motorola, inc. is an equal opportunity/affirmative action employer. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data mc68hc11p2 ? rev 1.0 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc11p2 ? rev 1.0 technical data list of paragraphs technical data ? mc68hc11p2 list of paragraphs list of paragraphs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 table of contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 list of figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 list of tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 section 1. general description . . . . . . . . . . . . . . . . . . . . 17 section 2. pin descriptions . . . . . . . . . . . . . . . . . . . . . . . 21 section 3. operating modes and on-chip memory . . . . 41 section 4. parallel input/output . . . . . . . . . . . . . . . . . . . . 73 section 5. serial communications interface (sci) . . . . . 87 section 6. motorola interconnect bus (mi bus). . . . . . 109 section 7. serial peripheral interface (spi). . . . . . . . . . 125 section 8. timing system. . . . . . . . . . . . . . . . . . . . . . . . 137 section 9. analog-to-digital converter . . . . . . . . . . . . . 173 section 10. resets and interrupts . . . . . . . . . . . . . . . . . 185 section 11. cpu core and instruction set . . . . . . . . . . 213 section 12. electrical specifications. . . . . . . . . . . . . . . 231 section 13. mechanical data . . . . . . . . . . . . . . . . . . . . . 247 section 14. ordering information . . . . . . . . . . . . . . . . . 251 section 15. development support. . . . . . . . . . . . . . . . . 253 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
list of paragraphs technical data mc68hc11p2 ? rev 1.0 list of paragraphs revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc11p2 ? rev 1.0 technical data table of contents technical data ? mc68hc11p2 table of contents list of paragraphs table of contents list of figures list of tables section 1. general description 1.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 1.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 1.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 section 2. pin descriptions 2.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2.3 vdd and vss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.4 reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.5 crystal driver and external clock input (xtal, extal) . . . . . .24 2.6 e clock output (e) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 2.7 phase-locked loop (xfc, vddsyn). . . . . . . . . . . . . . . . . . . . . 26 2.8 interrupt request (irq ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 2.9 nonmaskable interrupt (xirq /vppe). . . . . . . . . . . . . . . . . . . . 32 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
table of contents technical data mc68hc11p2 ? rev 1.0 table of contents 2.11 vrh and vrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 2.12 pg7/r/w . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 2.13 port signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 section 3. operating modes and on-chip memory 3.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 3.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 3.3 operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 3.4 on-chip memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 3.5 system initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 3.6 eprom, eeprom and config register . . . . . . . . . . . . . . . . 64 section 4. parallel input/output 4.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 4.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 4.3 port a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 4.4 port b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 4.5 port c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 4.6 port d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 4.7 port e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 4.8 port f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 4.9 port g . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81 4.10 port h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 4.11 internal pull-up/pull-down resistors . . . . . . . . . . . . . . . . . . . . . . 83 4.12 system configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
table of contents mc68hc11p2 ? rev 1.0 technical data table of contents section 5. serial communications interface (sci) 5.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 5.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 5.3 data format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 5.4 transmit operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .89 5.5 receive operation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 5.6 wakeup feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 5.7 sci error detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .92 5.8 sci registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 5.9 status flags and interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 5.10 additional sci subsystems . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 section 6. motorola interconnect bus (mi bus) 6.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 6.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 6.3 push-pull sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 6.4 the push field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 6.5 the pull field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 6.6 biphase coding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .113 6.7 message validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 6.8 interfacing to mi bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 6.9 mi bus clock rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 6.10 sci/mi bus2 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 6.11 sci/mi bus3 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
table of contents technical data mc68hc11p2 ? rev 1.0 table of contents section 7. serial peripheral interface (spi) 7.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 7.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 7.3 functional description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 7.4 spi transfer formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 7.5 spi signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 7.6 spi system errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 7.7 spi registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 section 8. timing system 8.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 8.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 8.3 timer structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 8.4 input capture. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 8.5 output compare . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 8.6 real-time interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .154 8.7 computer operating properly watchdog function . . . . . . . . . . 157 8.8 pulse accumulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .158 8.9 pulse-width modulation (pwm) timer . . . . . . . . . . . . . . . . . . . 162 section 9. analog-to-digital converter 9.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 9.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 9.3 overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 9.4 a/d converter power-up and clock select . . . . . . . . . . . . . . . . 178 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
table of contents mc68hc11p2 ? rev 1.0 technical data table of contents 9.7 operation in stop and wait modes. . . . . . . . . . . . . . . . . . . 184 section 10. resets and interrupts 10.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 10.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 10.3 resets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .185 10.4 effects of reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 10.5 reset and interrupt priority . . . . . . . . . . . . . . . . . . . . . . . . . . . 195 10.6 interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200 10.7 low power operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 section 11. cpu core and instruction set 11.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 11.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 11.3 registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 11.4 data types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 11.5 opcodes and operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 11.6 addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .221 11.7 instruction set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 section 12. electrical specifications 12.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 12.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 12.3 maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 12.4 thermal characteristics and power considerations. . . . . . . . . 233 12.5 test methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
table of contents technical data mc68hc11p2 ? rev 1.0 table of contents 12.7 control timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237 section 13. mechanical data 13.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247 13.2 pin assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 13.3 package dimensions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249 section 14. ordering information 14.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 14.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 section 15. development support 15.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 15.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 15.3 evs ? evaluation system . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 glossary revision history 15.4 major changes between revision 1.0 and revision 0.0 . . . .265 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc11p2 ? rev 1.0 technical data list of figures technical data ? mc68hc11p2 list of figures figure title page 1-1 mc68hc11p2/mc68hc711p2 block diagram . . . . . . . . . . . . . 19 2-1 84-pin plcc/cerquad pinout . . . . . . . . . . . . . . . . . . . . . . . . 22 2-2 external reset circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 2-3 oscillator connections. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 2-4 pll circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 2-5 ram stand-by connections. . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 3-1 mc68hc11p2 memory map. . . . . . . . . . . . . . . . . . . . . . . . . . . 44 3-2 ram and register overlap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 5-1 sci baud rate generator circuit diagram. . . . . . . . . . . . . . . . . . 88 5-2 sci1 block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 5-3 interrupt source resolution within sci. . . . . . . . . . . . . . . . . . . 103 6-1 mi bus timing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 6-2 biphase coding and error detection . . . . . . . . . . . . . . . . . . . . 113 6-3 mi bus block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 6-4 a typical interface between the mc68hc11p2 and the mi bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 7-1 spi block diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 7-2 spi transfer format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .128 8-1 timer clock divider chains . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 8-2 capture/compare block diagram. . . . . . . . . . . . . . . . . . . . . . . 141 8-3 pulse accumulator block diagram. . . . . . . . . . . . . . . . . . . . . .159 8-4 pwm timer block diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 8-5 pwm duty cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 9-1 a/d converter block diagram . . . . . . . . . . . . . . . . . . . . . . . . . 174 9-2 electrical model of an a/d input pin (in sample mode) . . . . . . 175 9-3 a/d conversion sequence. . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 10-1 processing flow out of reset (1 of 2) . . . . . . . . . . . . . . . . . . . . 206 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
list of figures technical data mc68hc11p2 ? rev 1.0 list of figures 10-4 interrupt priority resolution (2 of 3) . . . . . . . . . . . . . . . . . . . . . 209 10-5 interrupt priority resolution (3 of 3) . . . . . . . . . . . . . . . . . . . . . 210 10-6 interrupt source resolution within the sci subsystem. . . . . . . 211 11-1 programming model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 11-2 stacking operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216 12-1 test methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234 12-2 timer inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237 12-3 reset timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238 12-4 interrupt timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238 12-5 stop recovery timing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 12-6 wait recovery timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 12-7 port read timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240 12-8 port write timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240 12-9 spi master timing (cpha = 0) . . . . . . . . . . . . . . . . . . . . . . . . 243 12-10 spi master timing (cpha = 1) . . . . . . . . . . . . . . . . . . . . . . . . 243 12-11 spi slave timing (cpha = 0) . . . . . . . . . . . . . . . . . . . . . . . . . 244 12-12 spi slave timing (cpha = 1) . . . . . . . . . . . . . . . . . . . . . . . . . 244 12-13 expansion bus timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 13-1 84-pin plcc/cerquad pinout . . . . . . . . . . . . . . . . . . . . . . . 248 13-2 84-pin plcc mechanical dimensions. . . . . . . . . . . . . . . . . . . 249 13-3 84-pin cerquad mechanical dimensions . . . . . . . . . . . . . . 250 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc11p2 ? rev 1.0 technical data list of tables technical data ? mc68hc11p2 list of tables table title page 2-1 port signal functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 3-1 example bootloader baud rates . . . . . . . . . . . . . . . . . . . . . . . . 43 3-2 register and control bit assignments . . . . . . . . . . . . . . . . . . . .47 3-3 registers with limited write access . . . . . . . . . . . . . . . . . . . . . . 51 3-4 hardware mode select summary . . . . . . . . . . . . . . . . . . . . . . . 53 3-5 ram and register remapping . . . . . . . . . . . . . . . . . . . . . . . . . . 56 3-6 eeprom remapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 3-7 eeprom block protect. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 3-8 erase mode selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 4-1 port configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 5-1 example sci baud rate control values . . . . . . . . . . . . . . . . . . . 95 7-1 spi clock rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 8-1 timer resolution and capacity. . . . . . . . . . . . . . . . . . . . . . . . . 139 8-2 rti periodic rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 8-3 pulse accumulator timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 8-4 clock a and clock b prescalers . . . . . . . . . . . . . . . . . . . . . . . 167 9-1 a/d converter channel assignments . . . . . . . . . . . . . . . . . . . . 180 10-1 cop timer rate select . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 10-2 reset cause, reset vector and operating mode . . . . . . . . . . . 192 10-3 highest priority interrupt selection . . . . . . . . . . . . . . . . . . . . . 198 10-4 interrupt and reset vector assignments . . . . . . . . . . . . . . . . . 199 10-5 stacking order on entry to interrupts. . . . . . . . . . . . . . . . . . . . 201 11-1 reset vector comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 11-2 instruction set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 14-1 ordering information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 15-1 m68hc11 development tools . . . . . . . . . . . . . . . . . . . . . . . . . 253 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
list of tables technical data mc68hc11p2 ? rev 1.0 list of tables f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc11p2 ? rev 1.0 technical data general description technical data ? mc68hc11p2 section 1. general description 1.1 contents 1.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 1.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 1.2 introduction the mc68hc11p2 8-bit microcomputer is a member of the m68hc11 family of hcmos microcomputers. in addition to 32kbytes of rom, the mc68hc11p2 contains 1kbyte of ram and 640 bytes of eeprom. with its advanced timer and communication features (including mi bus (1) ) the mc68hc11p2 is especially suitable for mobile communications and automotive applications. the mc68hc711p2 is an eprom version of the mc68hc11p2, with the user rom replaced by a similar amount of eprom. all references to the mc68hc11p2 apply equally to the mc68hc711p2, unless otherwise noted. references specific to the mc68hc711p2 are italicised in the text. 1. the motorola interconnect bus (mi bus) is a serial communications protocol which supports distributed real-time control efficiently and with a high degree of noise immunity. it allows data f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general description technical data mc68hc11p2 ? rev 1.0 general description 1.3 features  low power, high performance m68hc11 cpu core, with 4mhz bus capability  power saving pll clock circuit, with automatic disable during wait mode  32kbytes of user rom (mc68hc11p2); 32kbytes user eprom (mc68hc711p2)  1kbyte of ram  640 bytes of byte-erasable user eeprom, with on-chip charge pump  up to 50 general purpose i/o lines, plus up to 12 input-only lines  non-multiplexed address and data buses, permitting direct access to the full 64k address map  16-bit timer with 3/4 input captures and 4/5 output compares; pulse accumulator and cop watchdog timer  three 8- or 9-bit sci subsystems, two with mi bus ? capability  spi subsystem, with software selectable msb/lsb first option  8-channel, 8-bit analog-to-digital (a/d) converter  four 8-bit pwm timer channels (may be concatenated to form one, or two, 16-bit channels)  available in 84-pin plcc or 84-pin cerquad packages f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general description features mc68hc11p2 ? rev 1.0 technical data general description pa7 pa6 pa5 pa4 pa2 pa1 pa0 pa3 pd5 pd4 pd3 pd2 pd1 pd0 pe7 pe6 pe5 pe4 pe2 pe1 pe0 pe3 pg7 pg6 pg5 pg4 pg2 pg1 pg0 pg3 ph7 ph6 ph5 ph4 ph2 ph1 ph0 ph3 oc1/pai oc1/oc2 oc1/oc3 oc1/oc4 ic4/oc1/oc5 ic1 ic2 ic3 timer cop watchdog periodic interrupt pulse accumulator port a port d port e port g port h ss sck mosi miso spi sci1+ txd1 rxd1 vrh vrl ad7 ad6 ad5 ad4 ad3 ad2 ad1 ad0 8-channel a/d converter pwm pw4 pw3 pw2 pw1 non-multiplexed address and data buses port b port f port c a15 a14 a13 a12 a11 a10 a9 a8 a7 a6 a5 a4 a3 a2 a1 a0 d7 d6 d5 d4 d3 d2 d1 d0 pb7 pb6 pb5 pb4 pb3 pb2 pb1 pb0 pf7 pf6 pf5 pf4 pf3 pf2 pf1 pf0 pc7 pc6 pc5 pc4 pc3 pc2 pc1 pc0 vppe/xirq irq reset lir /moda vstby/modb interrupts & mode select oscillator xtal extal e xfc vdd vss 5 5 640 bytes eeprom 1024 bytes ram m68hc11 cpu pll vddsyn sci2+ (with mi bus) txd2 rxd2 rom or eprom 32768 x 8 (including 64 bytes for vectors) r/w sci3+ (with mi bus) txd3 rxd3 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general description technical data mc68hc11p2 ? rev 1.0 general description f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc11p2 ? rev 1.0 technical data pin descriptions technical data ? mc68hc11p2 section 2. pin descriptions 2.1 contents 2.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2.3 vdd and vss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.4 reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.5 crystal driver and external clock input (xtal, extal) . . . 24 2.6 e clock output (e) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 2.7 phase-locked loop (xfc, vddsyn) . . . . . . . . . . . . . . . . . . . 26 2.8 interrupt request (irq) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 2.9 nonmaskable interrupt (xirq/vppe) . . . . . . . . . . . . . . . . . . 32 2.10 moda and modb (moda/lir and modb/vstby) . . . . . . . 33 2.11 vrh and vrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 2.12 pg7/r/w . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 2.13 port signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 2.2 introduction the mc68hc11p2 is available in an 84-pin plastic-leaded chip carrier (plcc); the mc68hc711p2 is also available in an 84-pin windowed cerquad package, to allow full use of the eprom. most pins on this mcu serve two or more functions, as described in the following paragraphs. refer to figure 2-1 which shows the pin assignments for both 84-pin packages. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pin descriptions technical data mc68hc11p2 ? rev 1.0 pin descriptions 2.3 vdd and vss power is supplied to the microcontroller via these pins. vdd is the positive supply and vss is ground. the mcu operates from a single 5v (nominal) power supply. it is in the nature of cmos designs that very fast signal transitions occur on the mcu pins. these short rise and fall times place very high short- duration current demands on the power supply. to prevent noise problems, special care must be taken to provide good power supply bypassing at the mcu. bypass capacitors should have good high- figure 2-1. 84-pin plcc/ cerquad pinout pb0/a8 pb1/a9 pb2/a10 pb3/a11 pb4/a12 pb5/a13 pb6/a14 pb7/a15 vss vdd pa0/ic3 pa1/ic2 pa2/ic1 pa3/oc1/oc5/ic4 pa4/oc1/oc4 pa5/oc1/oc3 pa6/oc1/oc2 pa7/oc1/pai pd5/ss pd4/sck pd3/mosi pg0 vdd ad ad7/pe7 ad6/pe6 ad5/pe5 ad4/pe4 ad3/pe3 ad2/pe2 ad1/pe1 ad0/pe0 vrl vrh vss ad a7/pf7 a6/pf6 a5/pf5 a4/pf4 a3/pf3 a2/pf2 a1/pf1 a0/pf0 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 11 10 9 8 7 6 5 4 3 2 84 83 82 81 80 79 78 77 76 75 pd2/miso pd1/txd1 pd0/rxd1 moda/lir reset xfc vddsyn extal xtal e vddr vssx pc7/d7 pc6/d6 pc5/d5 pc4/d4 pc3/d3 pc2/d2 pc1/d1 pc0/d0 irq pw1/ph0 pw2/ph1 pw3/ph2 pw4/ph3 rxd2/ph4 txd2/ph5 rxd3/ph6 txd3/ph7 modb/vstby xirq vdd vddl vssx vss r/w /pg7 pg6 pg5 pg4 pg3 pg2 pg1 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pin descriptions reset mc68hc11p2 ? rev 1.0 technical data pin descriptions bypassing requirements vary, depending on how heavily the mcu pins are loaded. the mc68hc11p2 mcu has five vdd pins and five vss pins. one pair of these pins is reserved for supplying power to the analog-to-digital converter (vdd ad, vss ad); two pairs are used for the internal logic (vdd, vss); the remaining two pairs supply power for the port logic on either half of the chip (vddl, vssx and vddr, vssx). this arrangement minimizes the injection of noise into the digital circuitry on the chip. 2.4 reset an active low bidirectional control signal, reset , acts as an input to initialize the mcu to a known start-up state. it also acts as an open-drain output to indicate that an internal failure has been detected in either the clock monitor or the cop watchdog circuit. the cpu distinguishes between internal and external reset conditions by sensing whether the reset pin rises to a logic one in less than six e clock cycles after a reset has occurred. it is therefore not advisable to connect an external resistor-capacitor (rc) power-up delay circuit to the reset pin of m68hc11 devices because the circuit charge time constant can cause the device to misinterpret the type of reset that occurred. refer to resets and interrupts for further information. figure 2-2 illustrates a typical reset circuit that includes an external switch together with a low voltage inhibit circuit, to prevent power transitions, or ram or eeprom corruption. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pin descriptions technical data mc68hc11p2 ? rev 1.0 pin descriptions 2.5 crystal driver and external clock input (xtal, extal) these two pins provide the interface for either a crystal or a cmos compatible clock to control the internal clock generator circuitry. the frequency applied to these pins must be four times higher than the desired e clock rate (unless the pll circuit is used to provide the e clock). the xtal pin is normally left unconnected when an external cmos compatible clock input is connected to the extal pin. however, a 10 k ? to 100 k ? load resistor connected from xtal to ground can be used to reduce rfi noise emission. the xtal output is normally intended to drive only a crystal. the xtal output can be buffered with a high- impedance buffer, or it can be used to drive the extal input of another m68hc11 family device. figure 2-2. external reset circuitry v dd 1f v dd 4.7 k? to m68hc11 reset v dd 1 2 3 1 2 3 in reset gnd in reset gnd mc34064 mc34164 manual reset 4.7 k? 4.7 k? f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pin descriptions crystal driver and external clock input (xtal, extal) mc68hc11p2 ? rev 1.0 technical data pin descriptions in all cases, use caution when designing circuitry associated with the oscillator pins. load capacitances shown in the oscillator circuits include all stray layout capacitances. see figure 2-3 . figure 2-3. oscillator connections 10 m ? 25 pf 4  e crystal 25 pf extal xtal m68hc11 note: capacitor values include all stray capacitance. m68hc11 extal xtal nc or 10 ? 100k ? load external oscillator 10 m ? 25 pf 4  e crystal 25 pf extal xtal m68hc11 m68hc11 extal xtal nc or 10 ? 100k ? 220 ? load (a) common crystal connections (b) external oscillator connections (c) one crystal driving two mcus f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pin descriptions technical data mc68hc11p2 ? rev 1.0 pin descriptions 2.6 e clock output (e) e is the output connection for the internally generated e clock. the signal from e is used as a timing reference. the frequency of the e clock output is one quarter that of the input frequency at the xtal and extal pins (except when the pll is used as the clock source). when e clock output is low, an internal process is taking place; when it is high, data is being accessed. all clocks, including the e clock, are halted when the mcu is in stop mode. the e clock output can be turned off in single chip modes to reduce the effects of rfi. 2.7 phase-locked loop (xfc, vddsyn) the xfc and vddsyn pins are the inputs for the on-chip pll (phase- locked loop) circuitry. on reset all the device clocks are derived from the extal input. the extal clock is used as a reference for the pll circuit, which generates a clock that is a multiple of the extal frequency. once the pll has stabilized, alternate clocks may be selected. vddsyn is the power supply pin for the pll. connecting it high enables the internal low frequency oscillator circuitry designed for the pll. the pll has been designed particularly for use with 614.4 and 640khz crystals, though other values may be used. the maximum recommended crystal frequency for pll operation is 2mhz. above this frequency vddsyn should be grounded to disable the pll and enable the high frequency oscillator circuit; in this state extal is designed for 16mhz operation and xfc may be left unconnected. the pll consists of a variable bandwidth loop filter, a voltage controlled oscillator (vco), a feedback frequency divider and a digital phase detector. vddsyn is the supply voltage for the pll and must be suitably bypassed. the external capacitor on xfc should be located as close to the chip as possible to minimize noise. a typical value for this capacitor is 0.047f, for a crystal frequency of 614.4khz. (1) 1. in general, a larger capacitor will improve the pll ? s frequency stability, at the expense of in- creasing the time required for it to settle (t ) at the desired frequency. for a 32khz appli- f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pin descriptions phase-locked loop (xfc, vddsyn) mc68hc11p2 ? rev 1.0 technical data pin descriptions the pll filter has two bandwidths that are automatically selected by the pll, if the auto bit in pllcr is set. whenever the pll is first enabled, the wide bandwidth mode is used. this enables the pll frequency to ramp up quickly. when the output frequency is near the desired value, the filter is switched to the narrow bandwidth mode, to make the final frequency more stable. manual control is possible, by clearing auto in pllcr, and setting the appropriate value for bwc. a block diagram of the pll circuitry is given in figure 2-4 . 2.7.1 synchronization of pll with subsystems the timer and sci subsystems operate off the extal clock, but are accessed by the cpu relative to the internal ph2 signal. although the extal clock is used as the reference for the pll, the ph2 clock and the module clocks for the timer and the sci are not synchronized. in order figure 2-4. pll circuit v ddsyn bus clock select module clock select frequency divider synr phase detect loop filter vco xfc t ref pcomp t fb extal mcs st4xck 4xclk bcs extal extal low frequency crystal oscillator to cl ock generation circuitry for sci and timer vcoout f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pin descriptions technical data mc68hc11p2 ? rev 1.0 pin descriptions 2.7.2 changing the pll frequency to change the pll frequency it is necessary to perform the following sequence of events, in order to prevent possible bursts of high frequency operation during the reconfiguration of the pll: 1. switch to the low frequency bus rate (bcs = 0) 2. disable the pll (pllon = 0) 3. change the value in synr 4. enable the pll (pllon = 1) 5. wait a time t plls for the pll frequency to stabilize 6. switch to the high frequency bus rate (bcs = 1) 2.7.3 pll registers two registers are used to control the operation of the mc68hc11p2 phase-locked loop circuitry. these are the pll control register and the synthesizer program register, each of which is described below. 2.7.3.1 pllcr ? pll control register this read/write register contains two bits that are used to enable and disable the synthesizer and to switch from slow (extal) to one of the fast speeds. two further bits are used to control the filter bandwidth. the sci and timer clock source and the slow clock for wait mode are also controlled by this register. pllon ? pll on 1 = switch pll on. 0 = switch pll off. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset pll control (pllcr) $002e pllon bcs auto bwc vcot mcs lck wen 1010 1000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pin descriptions phase-locked loop (xfc, vddsyn) mc68hc11p2 ? rev 1.0 technical data pin descriptions this bit activates the synthesizer circuit without connecting it to the control circuit. this allows the circuit to stabilize before it drives the cpu clocks. pllon is set by reset, to allow the control loop to stabilize during power up. pllon cannot be cleared whilst using vcoout to drive the internal processor clock, i.e. when bcs is set. bcs ? bus clock select 1 = vcoout output drives the clock circuit (4xclk). 0 = extal drives the clock circuit (4xclk). this bit determines which signal drives the clock circuit generating the bus clocks. once bcs has been altered it can take up to [1.5 extal + 1.5 vcoout] cycles for the change in the clock to occur. reset clears this bit. note: pllon and bcs have built-in safeguards so that vcoout cannot be selected as the clock source (bcs = 1) if the pll is off (pllon = 0). similarly, the pll cannot be turned off (pllon = 0) if it is on and in use (bcs = 1). turning the pll on and selecting vcoout as the clock source therefore requires two independent writes to pllcr. auto ? automatic bandwidth control 1 = automatic bandwidth control selected. 0 = manual bandwidth control selected. auto selects between automatic bandwidth control circuits in the phase detect block and manual bandwidth control. reset sets this bit. bwc ? bandwidth control 1 = high bandwidth control selected. 0 = low bandwidth control selected. bandwidth control is under manual control only when auto is clear. (when auto is set, bwc acts as a read-only status bit to indicate which mode has been selected by the internal circuit.) a delay of t plls is required between changes to bwc. the low bandwidth driver is always enabled, so this bit determines whether the high bandwidth driver is on or off. on pll start-up in automatic mode (auto = 1), the high bandwidth driver is enabled (bwc = 1) by internal circuitry until f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pin descriptions technical data mc68hc11p2 ? rev 1.0 pin descriptions the pll is near the specified frequency. the high bandwidth driver is then disabled and bwc is cleared by internal circuitry. reset clears this bit. vcot ? vco test (test mode only) 1 = loop filter operates as specified by auto and bwc. 0 = low bandwidth mode of the pll filter is disabled. this bit is used to isolate the loop filter from the vco for testing purposes. vcot is always set when auto = 1 when running in automatic mode. this bit is writable only in test mode. reset sets this bit. mcs ? module clock select 1 = 4xclk is the source for the sci and timer divider chain. 0 = extal is the source for the sci and timer divider chain. reset clears this bit. lck ? synthesizer lock detect 1 = the pll has stabilized. 0 = the pll is not stable. this bit is used as an indicator for software that it is all right to set bcs. wen ? wait enable 1 = low-power wait mode selected (pll set to ? idle ? in wait mode). 0 = do not alter the 4xclk during wait mode. this bit determines whether the 4xclk is disconnected from vcoout during wait and connected to extal. reset clears this bit. when set, the cpu will respond to a wait instruction by first stacking auto bwc high bandwidth 00 off 01 on 1xauto f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pin descriptions phase-locked loop (xfc, vddsyn) mc68hc11p2 ? rev 1.0 technical data pin descriptions any interrupt, any reset, or the assertion of raf in any of the scis will allow the pll to resume operating at the frequency specified in the synr. the user must set bcs after the pll has had time to adjust (t plls ). if, for a specific sci, the re bit is clear, then raf cannot become set, hence the pll will not resume normal operation. 2.7.3.2 synr ? synthesizer program register the pll frequency synthesizer multiplies the frequency of the crystal oscillator. the multiplication factor is software programmable via a loop divider, which consists of a six-bit modulo n counter, with a further two bit scaling factor. the multiplication factor is given by 2(y + 1)2 x , where 0 e x e 3 and 0 e y e 63. note: exceeding recommended operating frequencies can result in indeterminate mcu operation. synx[1:0] these bits program the binary taps (divide by 1, 2, 4 and 8). reset clears these bits. syny[5:0] these bits program the six-bit modulo n (1 to 64) counter. reset sets these bits to %001011. note: the resolution of the multiplication factors decreases by a factor of two, as x increases: addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset synthesizer program (synr) $002f synx1synx0 syny5syny4syny3syny2 syny1 syny0 0000 1011 x y possible multipliers 00 ? 63 2, 4, 6, 8, ? , 128 10 ? 63 4, 8, 12, 16, ? , 256 20 ? 63 8, 16, 24, 32, ? , 512 30 ? 63 16, 32, 48, 64, ? , 1024 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pin descriptions technical data mc68hc11p2 ? rev 1.0 pin descriptions 2.8 interrupt request (irq ) the irq input provides a means of applying asynchronous interrupt requests to the mcu. either falling edge sensitive triggering or level sensitive triggering is program selectable (option register). irq is always configured to level sensitive triggering at reset. note: connect an external pull-up resistor, typically 4.7 k ? , to v dd when irq is used in a level sensitive wired-or configuration. see also nonmaskable interrupt (xirq/vppe) . 2.9 nonmaskable interrupt (xirq /vppe) the xirq input provides a means of requesting a non-maskable interrupt after reset initialization. during reset, the x bit in the condition code register (ccr) is set and any interrupt is masked until mcu software enables it. because the xirq input is level-sensitive, it can be connected to a multiple-source wired-or network with an external pull- up resistor to v dd . xirq is often used as a power loss detect interrupt. whenever xirq or irq is used with multiple interrupt sources (irq must be configured for level sensitive operation if there is more than one source of irq interrupt), each source must drive the interrupt input with an open-drain type of driver to avoid contention between outputs. there should be a single pull-up resistor near the mcu interrupt input pin (typically 4.7 k ? ). there must also be an interlock mechanism at each interrupt source so that the source holds the interrupt line low until the mcu recognizes and acknowledges the interrupt request. if one or more interrupt source is still pending after the mcu services a request, the interrupt line will still be held low and the mcu will be interrupted again as soon as the interrupt mask bit in the mcu is cleared (normally upon return from an interrupt). refer to resets and interrupts . the vppe pin is used to input the external eprom programming voltage, which must be present during eprom programming. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pin descriptions moda and modb (moda/lir and modb/vstby) mc68hc11p2 ? rev 1.0 technical data pin descriptions 2.10 moda and modb (moda/lir and modb/vstby) during reset, moda and modb select one of the four operating modes. refer to operating modes and on-chip memory . after the operating mode has been selected, the lir pin provides an open-drain output to indicate that execution of an instruction has begun. the lir pin is normally configured for wired-or operation (only pulls low). in order to detect consecutive instructions in a high-speed application, this signal can be made to drive high for a short time to prevent false triggering. a series of e clock cycles occurs during execution of each instruction. the lir signal goes low during the first e clock cycle of each instruction (opcode fetch). this output is provided for assistance in program debugging and its operation is controlled by the lirdv bit in the opt2 register. the vstby pin is used to input ram stand-by power. the mcu is powered from the vdd pin unless the difference between the level of vstby and vdd is greater than one mos threshold (about 0.7 volts). when these voltages differ by more than 0.7 volts, the internal 1024-byte ram and part of the reset logic are powered from vstby rather than vdd. this allows ram contents to be retained without vdd power applied to the mcu. reset must be driven low before v dd is removed and must remain low until v dd has been restored to a valid level. figure 2-5. ram stand-by connections 4.7k ? (+) 4.8 v nicd v dd v dd v out v batt max 690 to modb/vstby pin of m68hc11 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pin descriptions technical data mc68hc11p2 ? rev 1.0 pin descriptions 2.11 vrh and vrl these pins provide the reference voltages for the analog-to-digital converter. 2.12 pg7/r/w this pin provides two separate functions, depending on the operating mode. in single chip and bootstrap modes, pg7/r/w acts as input/output port g bit 7. refer to parallel input/output for further information. in expanded and test modes, pg7/r/w performs the read/write function. pg7/r/w signals the direction of transfers on the external data bus. a high on this pin indicates that a read cycle is in progress. 2.13 port signals in the 84-pin plcc package, 62 pins are arranged into seven 8-bit ports: a, b, c, e, f, g, and h, and one six-bit port (d). the lines of ports a, b, c, d, f, g, and h are fully bidirectional; e is input only. each of the bidirectional ports serves a purpose other than i/o, depending on the operating mode or peripheral function selected. note that ports b, c, f, and one bit of port g are available for i/o functions only in single chip and bootstrap modes. refer to table 2-1 for details of the port signals ? functions in different operating modes. note: when using the information about port functions, do not confuse pin function with the electrical state of the pin at reset. all general-purpose i/o pins configured as inputs at reset are in a high-impedance state. port data registers reflect the functional state of the port at reset. the pin function is mode dependent. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pin descriptions port signals mc68hc11p2 ? rev 1.0 technical data pin descriptions 2.13.1 port a port a is an 8-bit general-purpose i/o port with a data register (porta) and a data direction register (ddra). port a pins share functions with the 16-bit timer system (see timing system for further information). porta can be read at any time: inputs return the pin level; outputs table 2-1. port signal functions port/bit single chip and bootstrap mode expanded multiplexed and special test mode pa0 pa0/ic3 pa1 pa1/ic2 pa2 pa2/ic1 pa3 pa3/oc5/ic4 and/or oc1 pa4 pa4/oc4 and/or oc1 pa5 pa5/oc3 and/or oc1 pa6 pa6/oc2 and/or oc1 pa7 pa7/pai and/or oc1 pb[7:0] pb[7:0] a[15:8] pc[7:0] pc[7:0] d[7:0] pd0 pd0/rxd1 pd1 pd1/txd1 pd2 pd2/miso pd3 pd3/mosi pd4 pd4/sck pd5 pd5/ss pe[7:0] input only or analog inputs pf[7:0] pf[7:0] a[7:0] pg[6:0] pg[6:0] pg7 pg7/r/w ph0 ph0/pw1 ph1 ph1/pw2 ph2 ph2/pw3 ph3 ph3/pw4 ph4 ph4/rxd2 ph5 ph5/txd2 ph6 ph6/rxd3 ph7 ph7/txd3 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pin descriptions technical data mc68hc11p2 ? rev 1.0 pin descriptions outputs. writes to porta do not change the pin state when the pins are configured for timer output compares. out of reset, port a pins [7:0] are general-purpose high-impedance inputs. when the functions associated with these pins are disabled, the bits in ddra govern the i/o state of the associated pin. for further information, refer to parallel input/output . 2.13.2 port b port b is an 8-bit general-purpose i/o port with a data register (portb) and a data direction register (ddrb). in single chip mode, port b pins are general-purpose i/o pins (pb[7:0]). in expanded mode, port b pins act as the high-order address lines (a[15:8]) of the address bus. portb can be read at any time: inputs return the pin level; outputs return the pin driver input level. if portb is written, the data is stored in internal latches. the pins are driven only if they are configured as outputs in single chip or bootstrap mode. for further information, refer to parallel input/output . port b pins include on-chip pull-up devices which can be enabled or disabled. 2.13.3 port c port c is an 8-bit general-purpose i/o port with a data register (portc) and a data direction register (ddrc). in single chip mode, port c pins are general-purpose i/o pins (pc[7:0]). in the expanded mode, port c pins are configured as data bus pins (d[7:0]). portc can be read at any time: inputs return the pin level; outputs return the pin driver input level. if portc is written, the data is stored in internal latches. the pins are driven only if they are configured as outputs in single chip or bootstrap mode. port c pins are general- purpose inputs out of reset in single chip and bootstrap modes. in expanded and test modes, these pins are data bus lines out of reset. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pin descriptions port signals mc68hc11p2 ? rev 1.0 technical data pin descriptions the cwom control bit in the opt2 register disables port c ? s p-channel output drivers. because the n-channel driver is not affected by cwom, setting cwom causes port c to become an open-drain-type output port suitable for wired-or operation. in wired-or mode (portc bits at logic level zero), the pins are actively driven low by the n-channel driver. when a port c bit is at logic level one, the associated pin is in a high impedance state as neither the n-channel nor the p-channel devices are active. it is customary to have an external pull-up resistor on lines that are driven by open-drain devices. port c can only be configured for wired-or operation when the mcu is in single chip mode. for further information, refer to parallel input/output . 2.13.4 port d port d, a 6-bit general-purpose i/o port, has a data register (portd) and a data direction register (ddrd). the six port d lines (d[5:0]) can be used for general-purpose i/o, for one of the serial communications interfaces (sci1, bits [0:1]) and for the serial peripheral interface (spi, bits [2:5]) subsystem. portd can be read at any time: inputs return the pin level; outputs return the pin driver input level. if portd is written, the data is stored in internal latches and are driven only if port d is configured for general- purpose output. for further information, refer to parallel input/output , serial communications interface (sci) and serial peripheral interface (spi) . 2.13.5 port e port e, pe/ad[7:0], is an input-only port that can also be used as the analog inputs for the analog-to-digital converter. for further information, refer to parallel input/output and analog-to- digital converter . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pin descriptions technical data mc68hc11p2 ? rev 1.0 pin descriptions 2.13.6 port f port f is an 8-bit general-purpose i/o port with a data register (portf) and a data direction register (ddrf). in single chip mode, port f pins are general-purpose i/o pins (pf[7:0]). in expanded mode, port f pins act as the low-order address lines (a[7:0]) of the address bus. portf can be read at any time: inputs return the pin level; outputs return the pin driver input level. if portf is written, the data is stored in internal latches. the pins are driven only if they are configured as outputs in single chip or bootstrap mode. port f pins include on-chip pull-up devices that can be enabled or disabled. for further information, refer to parallel input/output . 2.13.7 port g in normal modes, port g is an 8-bit general-purpose i/o port with a data register (portg) and a data direction register (ddrg). port g bit 7 is the r/w line in expanded mode; the remaining bits are always general purpose i/o. portg can be read at any time: inputs return the pin level; outputs return the pin driver input level. if portg is written, the data is stored in internal latches.the pins are driven only if they are configured as outputs in single chip or bootstrap mode. for further information, refer to parallel input/output . port g pins include on-chip pull-up devices that can be enabled or disabled. 2.13.8 port h port h is an 8-bit general-purpose i/o port with a data register (porth) and a data direction register (ddrh). port h pins support either input/output, sci2 (bits [7:6]), sci3 (bits [5:4]), or pulse-width f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pin descriptions port signals mc68hc11p2 ? rev 1.0 technical data pin descriptions porth can be read at any time: inputs return the pin level; outputs return the pin driver input level. if porth is written, the data is stored in internal latches. the pins are driven only if they are configured as outputs in single chip or bootstrap mode. port h pins include on-chip pull-up or pull-down devices that can be enabled or disabled via the port pull-up assignment register (ppar). port h [7:4] have pull-up resistors; port h [3:0] have pull-down resistors. for further information, refer to parallel input/output , serial communications interface (sci) , motorola interconnect bus (mi bus) and timing system . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pin descriptions technical data mc68hc11p2 ? rev 1.0 pin descriptions f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc11p2 ? rev 1.0 technical data operating modes and on-chip memory technical data ? mc68hc11p2 section 3. operating modes and on-chip memory 3.1 contents 3.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 3.3 operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 3.4 on-chip memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 3.5 system initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 3.6 eprom, eeprom and config register . . . . . . . . . . . . . . . 64 3.2 introduction this section contains information about the modes that define mc68hc11p2 operating conditions, and about the on-chip memory that allows the mcu to be configured for various applications. 3.3 operating modes the values of the mode select inputs modb and moda during reset determine the operating mode. single chip and expanded modes are the normal modes. in single chip mode only on-board memory is available. expanded mode, however, allows access to external memory. each of these two normal modes is paired with a special mode. bootstrap, a variation of the single chip mode, is a special mode that executes a bootloader program in an internal bootstrap rom. test is a special mode that allows privileged access to internal resources. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory technical data mc68hc11p2 ? rev 1.0 operating modes and on-chip memory 3.3.1 single chip operating mode in single chip operating mode, the mc68hc11p2 microcontroller has no external address or data bus. ports b, c, f, and the r/w pin are available for general-purpose parallel i/o. 3.3.2 expanded operating mode in expanded operating mode, the mcu can access a 64kbyte physical address space. the address space includes the same on-chip memory addresses used for single chip mode, in addition to external memory and peripheral devices. the expansion bus is made up of ports b, c, and f, and the r/w signal. in expanded mode, high order address bits are output on the port b pins, low order address bits on the port f pins, and the data bus on port c. the r/w /pg7 pin signals the direction of data transfer on the port c bus. 3.3.3 special test mode special test, a variation of the expanded mode, is primarily used during motorola ? s internal production testing; however, it is accessible for programming the config register, programming calibration data into eeprom, and supporting emulation and debugging during development. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory operating modes mc68hc11p2 ? rev 1.0 technical data operating modes and on-chip memory 3.3.4 special bootstrap mode when the mcu is reset in special bootstrap mode, a small on-chip rom is enabled at address $be40 ? $bfff. the rom contains a reset vector and a bootloader program. the mcu fetches the reset vector, then executes the bootloader. for normal use of the bootloader program, send a synchronization byte $ff to the sci receiver at either e clock 256, or e clock 1664 (7812 or 1200 baud respectively, for an e clock of 2mhz). then download up to 1024 bytes of program data (which is put into ram starting at $0080). these characters are echoed through the transmitter. the bootloader program ends the download after a timeout of four character times or 1024 bytes. when loading is complete, the program jumps to location $0080 and begins executing the code. use of an external pull-up resistor is required when using the sci transmitter pin (txd) because port d pins are configured for wired-or operation by the bootloader. in bootstrap mode, the interrupt vectors point to ram. this allows the use of interrupts through a jump table. further baud rate options are available on the mc68hc11p2 by using a different value for the synchronization byte, as shown in table 3-1 . refer also to motorola application note an1060, m68hc11 bootstrap mode (the bootloader mode is similar to that used on the mc68hc11k4). table 3-1. example bootloader baud rates sync. byte timeout delay baud rates for an e clock of: 2.00mhz 2.10mhz 3.00mhz 3.15mhz 4.00mhz $ff 4 char. 7812 8192 11718 12288 15624 $ff 4 1200 1260 1800 1890 2400 $f0 4.9 9600 10080 14400 15120 19200 $fd 17.3 5208 5461 7812 8192 10416 $fd 13 3906 4096 5859 6144 7812 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory technical data mc68hc11p2 ? rev 1.0 operating modes and on-chip memory 3.4 on-chip memory the mc68hc11p2 mcu includes 1024 bytes of on-chip ram, 32kbytes of rom/eprom and 640 bytes of eeprom. the bootloader rom occupies a 512 byte block of the memory map. the config register is implemented as a separate eeprom byte. 3.4.1 mapping allocations memory locations for on-chip resources are the same for both expanded and single chip modes. the 128-byte register block originates at $0000 after reset and can be placed at any other 4k boundary ($x000) after reset by writing an appropriate value to the init register. refer to figure 3-1 , which shows the memory map. figure 3-1. mc68hc11p2 memory map single chip expanded special bootstrap special test start address $0000 $0080 $0480 $0d80 $1000 $8000 $ffc0 ? $ffff $be40 $c000 each of these blocks can be mapped to any 4k page boundary, using the init register. ? ? ? ? ? this block may be remapped to any 4k page, using init2. special bootstrap mode only. special modes only. 32kbytes rom (mc68hc11p2) or 32kbytes eprom (mc68hc711p2) . can be mapped to either $0000 ? $7fff or $8000 ? $ffff, using the config register. normal mode vectors. vectors nvm 32kbytes vectors bootrom eeprom 640 bytes ram 1024 bytes register block $x000 $x07f $x080 $x47f $xd80 $xfff $be40 $bfff $8000 $ffff $ffbf f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory on-chip memory mc68hc11p2 ? rev 1.0 technical data operating modes and on-chip memory registers are both mapped to the same 4k boundary, ram starts at $x080 and 128 bytes are remapped at $x400 ? $x47f. otherwise, ram starts at $x000. remapping is accomplished by writing appropriate values into the two nibbles of the init register. the 640-byte eeprom is initially located at $0d80 after reset when eeprom is enabled in the memory map by the config register. eeprom can be placed at any other 4k boundary ($xd80) by writing to the init2 register. if rom is available, the romad and romon bits in the config register control the position and presence of rom in the memory map. in special test mode, the romon bit is cleared so the rom is removed from the memory map. in single chip mode, the romad bit is set to one after reset, which enables the rom at $8000 ? $ffff. in expanded mode, the rom may be enabled from $0000 ? 7fff (romad = 0) to allow an external memory to contain the interrupt vectors and initialization code. in special bootstrap mode, a bootloader rom is enabled at locations $be40 ? $bfff. the vectors for special bootstrap mode are contained in the bootloader program. the boot rom occupies a 512 byte block of the memory map, though not all locations are used. 3.4.1.1 ram the mc68hc11p2 has 1024 bytes of fully static ram that are used for storing instructions, variables and temporary data during program execution. ram can be placed at any 4k boundary in the 64kbyte address space by writing an appropriate value to the init register. by default, ram is initially located at $0080 in the memory map. direct addressing mode can access the first 128 locations of ram using a one- byte address operand. direct mode accesses save program memory space and execution time. registers can be moved to other boundaries to allow 256 bytes of ram to be located in direct addressing space. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory technical data mc68hc11p2 ? rev 1.0 operating modes and on-chip memory the on-chip ram is a fully static memory. ram contents can be preserved during periods of processor inactivity by either of two methods, both of which reduce power consumption: 1. during the software-based stop mode, mcu clocks are stopped, but the mcu continues to draw power from v dd . power supply current is directly related to operating frequency in cmos integrated circuits and there is very little leakage when the clocks are stopped. these two factors reduce power consumption while the mcu is in stop mode. 2. to reduce power consumption to a minimum, v dd can be turned off, and the modb/vstby pin can be used to supply ram power from either a battery back-up or a second power supply. although this method requires external hardware, it is very effective. refer to pin descriptions for information about how to connect the stand-by ram power supply and to resets and interrupts for a description of low power operation. 3.4.1.2 rom and eprom the mc68hc11p2 mcu has 32kbytes of rom/eprom. the rom/eprom array is enabled when the romon bit in the config register is set to one (erased). the romad bit in config places the rom/eprom at either $8000 ? $ffff out of reset (romad = 1) or at $0000 ? $7fff (romad = 0) in expanded mode. 3.4.1.3 bootloader rom the bootloader rom is enabled at address $be40 ? $bfff during special bootstrap mode. the reset vector is fetched from this rom and the mcu executes the bootloader firmware. in normal modes, the bootloader rom is disabled. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory on-chip memory mc68hc11p2 ? rev 1.0 technical data operating modes and on-chip memory 3.4.2 registers in table 3-2 , a summary of registers and control bits, the registers are shown in ascending order within the 128-byte register block. the addresses shown are for default block mapping ($0000 ? $007f), however, the init register remaps the block to any 4k page ($x000 ? $x07f). table 3-2. register and control bit assignments (sheet 1 of 4) register name address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset port a data (porta) $0000 pa7 pa6 pa5 pa4 pa3 pa2 pa1 pa0 undefined data direction a (ddra) $0001 dda7 dda6 dda5 dda4 dda3 dda2 dda1 dda0 0000 0000 data direction b (ddrb) $0002 ddb7 ddb6 ddb5 ddb4 ddb3 ddb2 ddb1 ddb0 0000 0000 data direction f (ddrf) $0003 ddf7 ddf6 ddf5 ddf4 ddf3 ddf2 ddf1 ddf0 0000 0000 port b data (portb) $0004 pb7 pb6 pb5 pb4 pb3 pb2 pb1 pb0 undefined port f data (portf) $0005 pf7 pf6 pf5 pf4 pf3 pf2 pf1 pf0 undefined port c data (portc) $0006 pc7 pc6 pc5 pc4 pc3 pc2 pc1 pc0 undefined data direction c (ddrc) $0007 ddc7 ddc6 ddc5 ddc4 ddc3 ddc2 ddc1 ddc0 0000 0000 port d data (portd) $0008 0 0 pd5 pd4 pd3 pd2 pd1 pd0 undefined data direction d (ddrd) $0009 0 0 ddd5 ddd4 ddd3 ddd2 ddd1 ddd0 0000 0000 port e data (porte) $000a pe7 pe6 pe5 pe4 pe3 pe2 pe1 pe0 undefined timer compare force (cforc) $000b foc1 foc2 foc3 foc4 foc5 0 0 0 0000 0000 output compare 1 mask (oc1m) $000c oc1m7 oc1m6 oc1m5 oc1m4 oc1m3 0 0 0 0000 0000 output compare 1 data (oc1d) $000d oc1d7 oc1d6 oc1d5 oc1d4 oc1d3 0 0 0 0000 0000 timer count (tcnt) high $000e (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) 0000 0000 timer count (tcnt) low $000f (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 0000 0000 timer input capture 1 (tic1) high $0010 (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) undefined timer input capture 1 (tic1) low $0011 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) undefined timer input capture 2 (tic2) high $0012 (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) undefined timer input capture 2 (tic2) low $0013 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) undefined timer input capture 3 (tic3) high $0014 (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) undefined timer input capture 3 (tic3) low $0015 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) undefined timer output compare 1 (toc1) high $0016 (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) 1111 1111 timer output compare 1 (toc1) low $0017 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 timer output compare 2 (toc2) high $0018 (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) 1111 1111 timer output compare 2 (toc2) low $0019 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory technical data mc68hc11p2 ? rev 1.0 operating modes and on-chip memory timer output compare 4 (toc4) high $001c (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) 1111 1111 timer output compare 4 (toc4) low $001d (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 capture 4/compare 5 (ti4/o5) high $001e (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) 1111 1111 capture 4/compare 5 (ti4/o5) low $001f (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 timer control 1 (tctl1) $0020 om2 ol2 om3 ol3 om4 ol4 om5 ol5 0000 0000 timer control 2 (tctl2) $0021 edg4b edg4a edg1b edg1a edg2b edg2a edg3b edg3a 0000 0000 timer interrupt mask 1 (tmsk1) $0022 oc1i oc2i oc3i oc4i i4/o5i ic1i ic2i ic3i 0000 0000 timer interrupt flag 1 (tflg1) $0023 oc1f oc2f oc3f oc4f i4/o5f ic1f ic2f ic3f 0000 0000 timer interrupt mask 2 (tmsk2) $0024 toi rtii paovi paii 0 0 pr1 pr0 0000 0000 timer interrupt flag 2 (tflg2) $0025 tof rtif paovf paif 0 0 0 0 0000 0000 pulse accumulator control (pactl) $0026 0 paen pamod pedge 0 i4/o5 rtr1 rtr0 0000 0000 pulse accumulator count (pacnt) $0027 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) undefined spi control (spcr) $0028 spie spe dwom mstr cpol cpha spr1 spr0 0000 01uu spi status (spsr) $0029 spif wcol 0 modf 0 0 0 0 0000 0000 spi data (spdr) $002a (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) undefined eprom programming (eprog) ? $002b mbe 0 elat excol exrow 0 0 epgm 0000 0000 port pull-up assignment (ppar) $002c 0 0 0 0 hppue gppue fppue bppue 0000 1111 reserved $002d pll control (pllcr) $002e pllon bcs auto bwc vcot mcs lck wen 1010 1000 synthesizer program (synr) $002f synx1 synx0 syny5 syny4 syny3 syny2 syny1 syny0 0000 1011 a/d control & status (adctl) $0030 ccf 0 scan mult cd cc cb ca u0uu uuuu a/d result 1 (adr1) $0031 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) undefined a/d result 2 (adr2) $0032 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) undefined a/d result 3 (adr3) $0033 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) undefined a/d result 4 (adr4) $0034 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) undefined block protect (bprot) $0035 bulkp 0 bprt4 ptcon bprt3 bprt2 bprt1 bprt0 1011 1111 reserved $0036 eeprom mapping (init2) $0037 ee3 ee2 ee1 ee0 m3dl1 m3dl0 m2dl1 m2dl0 0000 0000 system config. options 2 (opt2) $0038 lirdv cwom strch irvne lsbf spr2 0 0 000x 0000 system config. options 1 (option) $0039 adpu csel irqe dly cme fcme cr1 cr0 0001 0000 cop timer arm/reset (coprst) $003a (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) undefined eeprom programming (pprog) $003b odd even 0 byte row erase eelat eepgm 0000 0000 highest priority interrupt (hprio) $003c rboot smod mda psel4 psel3 psel2 psel1 psel0 xxx0 0110 ram & i/o mapping (init) $003d ram3 ram2 ram1 ram0 reg3 reg2 reg1 reg0 0000 0000 table 3-2. register and control bit assignments (sheet 2 of 4) register name address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory on-chip memory mc68hc11p2 ? rev 1.0 technical data operating modes and on-chip memory reserved $0040 reserved $0041 reserved $0042 reserved $0043 reserved $0044 reserved $0045 reserved $0046 reserved $0047 reserved $0048 reserved $0049 reserved $004a reserved $004b reserved $004c reserved $004d reserved $004e reserved $004f sci/mi 2/3 baud high (s2bdh) $0050 b2tst b2spl 0 s2b12 s2b11 s2b10 s2b9 s2b8 0000 0000 sci/mi 2/3 baud low (s2bdl) $0051 s2b7 s2b6 s2b5 s2b4 s2b3 s2b2 s2b1 s2b0 0000 0100 sci/mi 2 control 1 (s2cr1) $0052 lops2 woms2 mie2 m2 wake2 ilt2 pe2 pt2 0000 0000 sci/mi 2 control 2 (s2cr2) $0053 tie2 tcie2 rie2 ilie2 te2 re2 rwu2 sbk2 0000 0000 sci/mi 2 status 1 (s2sr1) $0054 tdre2 tc2 rdrf2 idle2 or2 nf2 fe2 pf2 1100 0000 sci/mi 2 status 2 (s2sr2) $0055 0 0 0 0 0 0 0 raf2 0000 0000 sci/mi 2 data high (s2drh) $0056 r8b t8b 0 0 0 0 0 0 undefined sci/mi 2 data low (s2drl) $0057 r7t7b r6t6b r5t5b r4t4b r3t3b r2t2b r1t1b r0t0b undefined reserved $0058 reserved $0059 sci/mi 3 control 1 (s3cr1) $005a lops3 woms3 mie3 m3 wake3 ilt3 pe3 pt3 0000 0000 sci/mi 3 control 2 (s3cr2) $005b tie3 tcie3 rie3 ilie3 te3 re3 rwu3 sbk3 0000 0000 sci/mi 3 status 1 (s3sr1) $005c tdre3 tc3 rdrf3 idle3 or3 nf3 fe3 pf3 1100 0000 sci/mi 3 status 2 (s3sr2) $005d 0 0 0 0 0 0 0 raf3 0000 0000 sci/mi 3 data high (s3drh) $005e r8c t8c 0 0 0 0 0 0 undefined sci/mi 3 data low (s3drl) $005f r7t7c r6t6c r5t5c r4t4c r3t3c r2t2c r1t1c r0t0c undefined pulse width clock select (pwclk) $0060 con34 con12 pcka2 pcka1 0 pckb3 pckb2 pckb1 0000 0000 pulse width polarity select (pwpol) $0061 pclk4 pclk3 pclk2 pclk1 ppol4 ppol3 ppol2 ppol1 0000 0000 pulse width scale (pwscal) $0062 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 0000 0000 table 3-2. register and control bit assignments (sheet 3 of 4) register name address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory technical data mc68hc11p2 ? rev 1.0 operating modes and on-chip memory pulse width count 2 (pwcnt2) $0065 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 0000 0000 pulse width count 3 (pwcnt3) $0066 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 0000 0000 pulse width count 4 (pwcnt4) $0067 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 0000 0000 pulse width period 1 (pwper1) $0068 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 pulse width period 2 (pwper2) $0069 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 pulse width period 3 (pwper3) $006a (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 pulse width period 4 (pwper4) $006b (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 pulse width duty 1 (pwdty1) $006c (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 pulse width duty 2 (pwdty2) $006d (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 pulse width duty 3 (pwdty3) $006e (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 pulse width duty 4 (pwdty4) $006f (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 sci 1 baud rate high (scbdh) $0070 btst bspl 0 sbr12 sbr11 sbr10 sbr9 sbr8 0000 0000 sci 1 baud rate low (scbdl) $0071 sbr7 sbr6 sbr5 sbr4 sbr3 sbr2 sbr1 sbr0 0000 0100 sci 1 control 1 (sccr1) $0072 loops woms 0 m wake ilt pe pt 0000 0000 sci 1 control 2 (sccr2) $0073 tie tcie rie ilie te re rwu sbk 0000 0000 sci 1 status 1 (scsr1) $0074 tdre tc rdrf idle or nf fe pf 1100 0000 sci 1 status 2 (scsr2) $0075 0 0 0 0 0 0 0 raf 0000 0000 sci 1 data high (scdrh) $0076 r8 t8 0 0 0 0 0 0 undefined sci 1 data low (scdrl) $0077 r7t7 r6t6 r5t5 r4t4 r3t3 r2t2 r1t1 r0t0 undefined reserved $0078 reserved $0079 reserved $007a reserved $007b port h data (porth) $007c ph7 ph6 ph5 ph4 ph3 ph2 ph1 ph0 undefined data direction h (ddrh) $007d ddh7 ddh6 ddh5 ddh4 ddh3 ddh2 ddh1 ddh0 0000 0000 port g data (portg) $007e pg7 pg6 pg5 pg4 pg3 pg2 pg1 pg0 undefined data direction g (ddrg) $007f ddg7 ddg6 ddg5 ddg4 ddg3 ddg2 ddg1 ddg0 0000 0000 table 3-2. register and control bit assignments (sheet 4 of 4) register name address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset key ? applies only to eprom devices x state on reset depends on mode selected u state of bit on reset is undefined f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory system initialization mc68hc11p2 ? rev 1.0 technical data operating modes and on-chip memory 3.5 system initialization registers and bits that control initialization and the basic operation of the mcu are protected against writes except under special circumstances. the following table lists registers that can be written only once after reset, or that must be written within the first 64 cycles after reset. 3.5.1 mode selection the four mode variations are selected by the logic states of the mode a (moda) and mode b (modb) pins during reset. the moda and modb logic levels determine the logic state of special mode (smod) and the mode a (mda) control bits in the highest priority i-bit interrupt and miscellaneous (hprio) register. after reset is released, the mode select pins no longer influence the mcu operating mode. in single chip operating mode, moda pin is connected to a logic zero. in expanded mode, moda is normally connected to v dd through a pull-up resistor of 4.7 k ? . the moda pin also functions as the load instruction register (lir ) pin when the mcu is not in reset. the open-drain active low lir output pin drives low during the first e cycle of each instruction. the modb pin also functions as the table 3-3. registers with limited write access register address register name must be written in first 64 cycles write once only $x024 timer interrupt mask register 2 (tmsk2) (1) ? $x035 block protect register (bprot) (2) ? $x037 eeprom mapping register (init2) no yes $x038 system configuration options register 2 (opt2) no (3) $x039 system configuration options register (option) (4) ? $x03d ram and i/o map register (init) yes ? 1. bits 1 and 0 can be written once and only in first 64 cycles; when smod = 1, however, these bits can be written at any time. all other bits can be written at any time. 2. bits can be written to zero once and only in first 64 cycles or in special modes. bits can be set to one at any time. 3. bit 4 (irvne) can be written only once. 4. bits 5, 4, 2, 1, and 0 can be written once and only in first 64 cycles; when smod = 1, however, bits 5, 4, 2, 1, and 0 can be written at any time. all other bits can be written at any time. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory technical data mc68hc11p2 ? rev 1.0 operating modes and on-chip memory stand-by power input (vstby), which allows the ram contents to be maintained in the absence of v dd . refer to table 3-4 , which is a summary of mode pin operation, the mode control bits and the four operating modes. a normal mode is selected when modb is logic one during reset. one of three reset vectors is fetched from address $fffa ? $ffff, and program execution begins from the address indicated by this vector. if modb is logic zero during reset, the special mode reset vector is fetched from addresses $bffa ? $bfff and software has access to special test features. refer to resets and interrupts . 3.5.1.1 hprio ? highest priority i-bit interrupt & misc. register note: rboot, smod and mda bits depend on the power-up initialization mode and can only be written in special modes when smod = 1. refer to table 3-4 . rboot ? read bootstrap rom 1 = bootloader rom enabled, at $be40 ? $bfff. 0 = bootloader rom disabled and not in map. smod ? special mode select 1 = special mode variation in effect. 0 = normal mode variation in effect. once cleared, cannot be set again. mda ? mode select a 1 = normal expanded or special test mode. (expanded buses active.) 0 = normal single chip or special bootstrap mode. (ports active.) addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset highest priority interrupt (hprio) $003c rboo t smod mda psel4 psel3 psel2 psel1 psel0 xxx0 0110 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory system initialization mc68hc11p2 ? rev 1.0 technical data operating modes and on-chip memory psel[4:0] ? priority select bits (refer to resets and interrupts ) 3.5.2 initialization because bits in the following registers control the basic configuration of the mcu, an accidental change of their values could cause serious system problems. the protection mechanism, overridden in special operating modes, requires a write to the protected bits only within the first 64 bus cycles after any reset, or only once after each reset. see table 3-3 . 3.5.2.1 config ? system configuration register config controls the presence and/or location of rom and eeprom in the memory map and enables the cop watchdog system. a security feature that protects data in eeprom and ram is available on mask programmed mcus, controlled by the nosec bit. refer to ram and eeprom security . config is made up of eeprom cells and static working latches. the operation of the mcu is controlled directly by these latches and not the eeprom byte. when programming the config register, the eeprom table 3-4. hardware mode select summary inputs mode control bits in hprio (latched at reset) modb moda rboot smod mda 1 0 single chip 0 0 0 1 1 expanded 0 0 1 0 0 special bootstrap 1 1 0 0 1 special test 0 1 1 addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset configuration control (config) $003f roma d 11 pare n nose c noco p romo n eeon x11x 1xxx f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory technical data mc68hc11p2 ? rev 1.0 operating modes and on-chip memory these bits can be read at any time. the value read is the one latched into the register from the eeprom cells during the last reset sequence. a new value programmed into this register is not readable until after a subsequent reset sequence. unused bits always read as ones. if smod = 1, config bits can be written at any time. if smod = 0, config bits can only be written using the eeprom programming sequence, and are neither readable nor active until latched via the next reset. romad ? rom mapping control 1 = rom addressed from $8000 to $ffff. 0 = rom addressed from $0000 to $7fff (expanded mode only). in single chip mode, reset sets this bit. bits [6,5] ? not implemented; always read one paren ? pull-up assignment register enable (see parallel input/output ) 1 = ppar register enabled; pull-ups can be enabled using ppar. 0 = ppar register disabled; all pull-ups disabled. nosec ? eeprom security disabled (see ram and eeprom security ) 1 = disable security. 0 = enable security. nocop ? cop system disable (see resets and interrupts ) 1 = cop system disabled. 0 = cop system enabled (forces reset on timeout). romon ? rom enable 1 = rom included in the memory map. 0 = rom excluded from the memory map. in single chip mode, reset sets this bit. in special test mode, reset clears romon. eeon ? eeprom enable 1 = eeprom included in the memory map. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory system initialization mc68hc11p2 ? rev 1.0 technical data operating modes and on-chip memory 3.5.2.2 init ? ram and i/o mapping register the internal registers used to control the operation of the mcu can be relocated on 4k boundaries within the memory space with the use of init. this 8-bit special-purpose register can change the default locations of the ram and control registers within the mcu memory map. it can be written to only once within the first 64 e clock cycles after a reset. it then becomes a read-only register. ram[3:0] ? ram map position these four bits, which specify the upper hexadecimal digit of the ram address, control the position of the ram in the memory map. the ram can be positioned at the beginning of any 4k page in the memory map. refer to table 3-5 . reg[3:0] ? 128-byte register block position these four bits specify the upper hexadecimal digit of the address for the 128-byte block of internal registers. the register block is positioned at the beginning of any 4k page in the memory map. refer to table 3-5 . addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset ram & i/o mapping (init) $003d ram3 ram2 ram1 ram0 reg3 reg2 reg1 reg0 0000 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory technical data mc68hc11p2 ? rev 1.0 operating modes and on-chip memory note: when the memory map has the 128-byte register block mapped at the same location as ram, the registers have priority and the ram is relocated to the memory space immediately following the register block. this mapping feature keeps all the ram available for use. refer to figure 3-2 , which illustrates the overlap. table 3-5. ram and register remapping ram[3:0] location reg[3:0] location 0000 $0000 ? $03ff 0000 $0000 ? $007f 0001 $1000 ? $13ff 0001 $1000 ? $107f 0010 $2000 ? $23ff 0010 $2000 ? $207f 0011 $3000 ? $33ff 0011 $3000 ? $307f 0100 $4000 ? $43ff 0100 $4000 ? $407f 0101 $5000 ? $53ff 0101 $5000 ? $507f 0110 $6000 ? $63ff 0110 $6000 ? $607f 0111 $7000 ? $73ff 0111 $7000 ? $707f 1000 $8000 ? $83ff 1000 $8000 ? $807f 1001 $9000 ? $93ff 1001 $9000 ? $907f 1010 $a000 ? $a3ff 1010 $a000 ? $a07f 1011 $b000 ? $b3ff 1011 $b000 ? $b07f 1100 $c000 ? $c3ff 1100 $c000 ? $c07f 1101 $d000 ? $d3ff 1101 $d000 ? $d07f 1110 $e000 ? $e3ff 1110 $e000 ? $e07f 1111 $f000 ? $f3ff 1111 $f000 ? $f07f f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory system initialization mc68hc11p2 ? rev 1.0 technical data operating modes and on-chip memory 3.5.2.3 init2 ? eeprom mapping and mi bus delay register this register determines the location of eeprom in the memory map. init2 may be read at any time but bits 7 ? 4 may be written only once after reset in normal modes (bits 3 ? 0 may be written at any time). ee[3:0] ? eeprom map position eeprom is located at $xd80 ? $xfff, where x is the hexadecimal digit represented by ee[3:0]. refer to table 3-6 . figure 3-2. ram and register overlap $x000 $x07f $x080 $x3ff $x400 $x47f ram b ram a register block $x000 $x07f $x080 $x3ff ram b ram a register and ram mapped to different 4k boundaries. register and ram mapped to the same 4k boundary. addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset eeprom mapping (init2) $0037 ee3 ee2 ee1 ee0 m3dl1 m3dl0 m2dl1 m2dl0 0000 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory technical data mc68hc11p2 ? rev 1.0 operating modes and on-chip memory m3dl1, m3dl0, m2dl1, m2dl0 ? mi bus delay select (refer to motorola interconnect bus (mi bus) ) 3.5.2.4 option ? system configuration options register 1 the 8-bit special-purpose option register sets internal system configuration options during initialization. the time protected control bits, irqe, dly, fcme and cr[1:0] can be written only once in the first 64 cycles after a reset and then they become read-only bits. this minimizes the possibility of any accidental changes to the system configuration. they may be written at any time in special modes. adpu ? a/d power-up (refer to analog-to-digital converter ) table 3-6. eeprom remapping ee[3:0] location 0000 $0d80 ? $0fff 0001 $1d80 ? $1fff 0010 $2d80 ? $2fff 0011 $3d80 ? $3fff 0100 $4d80 ? $4fff 0101 $5d80 ? $5fff 0110 $6d80 ? $6fff 0111 $7d80 ? $7fff 1000 $8d80 ? $8fff 1001 $9d80 ? $9fff 1010 $ad80 ? $afff 1011 $bd80 ? $bfff 1100 $cd80 ? $cfff 1101 $dd80 ? $dfff 1110 $ed80 ? $efff 1111 $fd80 ? $ffff addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset system config. options 1 (option) $0039 adpu csel irqe dly cme fcme cr1 cr0 0001 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory system initialization mc68hc11p2 ? rev 1.0 technical data operating modes and on-chip memory after enabling the a/d power, at least 100s should be allowed for system stabilization. csel ? clock select (refer to analog-to-digital converter ) 1 = a/d and eeprom use internal rc clock source (about 1.5mhz). 0 = a/d and eeprom use system e clock (must be at least 1mhz). selects alternate clock source for on-chip eeprom and a/d charge pumps. the on-chip rc clock should be used when the e clock frequency falls below 1mhz. irqe ? configure irq for falling edge sensitive operation 1 = falling edge sensitive operation. 0 = low level sensitive operation. dly ? enable oscillator start-up delay 1 = a delay of approximately 4064 e clock cycles is imposed as the mcu is started up from the stop mode. 0 = the oscillator start-up delay coming out of stop is bypassed and the mcu resumes processing within about four bus cycles. a stable external oscillator is required if this option is selected. cme ? clock monitor enable (refer to resets and interrupts ) 1 = clock monitor enabled. 0 = clock monitor disabled. in order to use both stop and clock monitor, the cme bit should be set before executing stop, then set again after recovering from stop. fcme ? force clock monitor enable (refer to resets and interrupts ) 1 = clock monitor enabled; cannot be disabled until next reset. 0 = clock monitor follows the state of the cme bit. when fcme is set, slow or stopped clocks will cause a clock failure reset sequence. to utilize stop mode, fcme should always be cleared. cr[1:0] ? cop timer rate select bits (refer to resets and interrupts ) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory technical data mc68hc11p2 ? rev 1.0 operating modes and on-chip memory 3.5.2.5 opt2 ? system configuration options register 2 lirdv ? lir driven 1 = enable lir drive high pulse. 0 = lir only driven low (requires pull-up on pin). in single chip and bootstrap modes, this bit has no meaning or effect. the lir pin is normally configured for wired-or operation (only pulls low). in order to detect consecutive instructions in a high-speed application, this signal can be made to drive high for a quarter of a cycle to prevent false triggering. cwom ? port c wired-or mode 1 = port c outputs are open-drain. 0 = port c operates normally. strch ? stretch external accesses 1 = off-chip accesses are extended by one e clock cycle. 0 = normal operation. when this bit is set, off-chip accesses of addresses $0000 ? $7fff ($8000 ? $ffff, if romad is clear) are extended by one e clock cycle to allow access to slow peripherals. the e clock stretches externally, but the internal clocks are not affected, so that timers and serial systems are not corrupted. in single chip and boot modes this bit has no effect. irvne ? internal read visibility/not e irvne can be written once in any user mode. in expanded modes , irvne determines whether irv is on or off. in special test mode, irvne is reset to one. in all other modes, irvne is reset to zero. 1 = data from internal reads is driven out of the external data bus. 0 = no visibility of internal reads on external bus. addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset system config. options 2 (opt2) $0038 lirdv cwom strc h irvne lsbf spr2 0 0 000x 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory system initialization mc68hc11p2 ? rev 1.0 technical data operating modes and on-chip memory in single chip modes this bit determines whether the e clock drives out from the chip. 1 = e pin is driven low. 0 = e clock is driven out from the chip. refer to the following table for a summary of the operation immediately following reset. lsbf ? lsb-first enable (refer to serial peripheral interface (spi) ) 1 = data is transferred lsb first. 0 = data is transferred msb first. spr2 ? spi clock rate select (refer to serial peripheral interface (spi) ) this bit adds a divide-by-four to the spi clock chain. bits 1, 0 ? not implemented; always read zero. 3.5.2.6 bprot ? block protect register bprot prevents accidental writes to eeprom and the config register. the bits in this register can be written to zero only once during the first 64 e clock cycles after reset in the normal modes; they can be set at any time. once the bits are cleared, the eeprom array and the config register can be programmed or erased. setting the bits in the bprot register to logic one protects the eeprom and config table 3-7 mode irvne after reset e clock after reset irv after reset irvne affects only irvne can be written single chip 0 on off e once expanded 0 on off irv once boot 0 on off e once special test 1 on on irv unlimited addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset block protect (bprot) $0035 bulkp 0 bprt4 ptco n bprt3 bprt2 bprt1 bprt0 1011 1111 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory technical data mc68hc11p2 ? rev 1.0 operating modes and on-chip memory bulkp ? bulk erase of eeprom protect 1 = eeprom cannot be bulk or row erased. 0 = eeprom can be bulk erased normally. bit 6 ? not implemented; always reads zero. bprt4 ? block protect bit for top 128 bytes of eeprom (see below) ptcon ? protect for config register 1 = config register cannot be programmed or erased. 0 = config register can be programmed or erased normally. note that, in special modes, config may be written regardless of the state of ptcon. bprt[4:0] ? block protect bits for eeprom 1 = protection is enabled for associated block; it cannot be programmed or erased. 0 = protection disabled for associated block. each of these five bits protects a block of eeprom against writing or erasure, as follows: table 3-7. eeprom block protect bit name block protected block size bprt0 $xd80 ? $xd9f 32 bytes bprt1 $xda0 ? $xddf 64 bytes bprt2 $xde0 ? $xe5f 128 bytes bprt3 $xe60 ? $xf7f 288 bytes bprt4 $xf80 ? $xfff 128 bytes f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory system initialization mc68hc11p2 ? rev 1.0 technical data operating modes and on-chip memory 3.5.2.7 tmsk2 ? timer interrupt mask register 2 pr[1:0] are time-protected control bits and can be changed only once and then only within the first 64 bus cycles after reset in normal modes. note: bits in tmsk2 correspond bit for bit with flag bits in tflg2. ones in tmsk2 enable the corresponding interrupt sources. toi ? timer overflow interrupt enable 1 = interrupt requested when tof is set. 0 = tof interrupts disabled. rtii ? real-time interrupt enable 1 = interrupt requested when rtif set. 0 = rtif interrupts disabled. paovi ? pulse accumulator overflow interrupt enable (refer to timing system ) 1 = interrupt requested when paovf set. 0 = paovf interrupts disabled. paii ? pulse accumulator interrupt enable (refer to timing system ) 1 = interrupt requested when paif set. 0 = paif interrupts disabled. pr[1:0] ? timer prescaler select these two bits select the prescale rate for the main 16-bit free-running timer system. these bits can be written only once during the first 64 e clock cycles after reset in normal modes, or at any time in special modes. refer to the following table: addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset timer interrupt mask 2 (tmsk2) $0024 toi rtii paovi paii 0 0 pr1 pr0 0000 0000 pr[1:0] prescale factor 0 0 1 0 1 4 1 0 8 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory technical data mc68hc11p2 ? rev 1.0 operating modes and on-chip memory 3.6 eprom, eeprom and config register 3.6.1 eprom using the on-chip eprom programming feature requires an external power supply (v ppe ). normal programming is accomplished using the eprog register. program eprom at room temperature only and place an opaque label over the quartz window after programming. the erased state of each eprom byte is $ff. 3.6.1.1 eprog ? eprom programming control register mbe ? multiple byte program enable 1 = program four bytes with the same data. 0 = normal programming. when programming four bytes simultaneously, address bits 7 and 4 are ignored, hence a write to, for example, $99 will actually program $09, $19, $89 and $99 (i.e. %x00x 1001). this bit may be read or written only in special modes; it will always read zero in normal modes. bits 6, 2, 1 ? not implemented; always read zero. elat ? eprom latch control 1 = eprom address and data buses configured for programming. eprom cannot be read. 0 = eprom address and data buses configured for normal operation. when set, this bit causes the address and data for writes to the eprom to be latched. elat may be read and written at any time. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset eprom programming (eprog) $002b mbe 0 elat exco l exro w 0 0 epgm 0000 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory eprom, eeprom and config register mc68hc11p2 ? rev 1.0 technical data operating modes and on-chip memory excol ? select extra columns 1 = user array disabled; extra column selected. 0 = user array selected. the extra column may be accessed at bit 7; addresses use bits 11 ? 5, bits 4 ? 0 must be ones. the excol bit always reads zero in normal modes and may be read or written only in special modes. exrow ? select extra rows 1 = user array disabled; extra rows selected. 0 = user array selected. there are four extra rows (two in each block). addresses use bits 6 ? 0, bits 11 ? 7 must be zeros. (the high nibble determines which 16k block is accessed.) the exrow bit always reads zero in normal modes and may be read or written only in special modes. epgm ? eprom program command 1 = programming voltage (v ppe ) switched to the eprom array. 0 = programming voltage (v ppe ) disconnected from the eprom array. this bit can be read at any time, but may only be written if elat is set. note: if elat = 0 (normal operation) then epgm = 0 (programming voltage disconnected). 3.6.1.2 eprom programming the eprom may be programmed and verified in software, via the mcu, using the following procedure. the romon bit in the config register should be set. on entry, a contains the data to be programmed and x contains the eprom address. eprog ldab #$20 stab $102b set elat bit (pgm=0) to enable eprom latches. staa $0, x store data to eprom address ldab #$21 stab $102b set epgm bit, with elat=1, to enable prog. voltage jsr dlyep delay 2?4 ms clr $102b turn off programming voltage and set to read mode with this method, the eprom is programmed by software while in the f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory technical data mc68hc11p2 ? rev 1.0 operating modes and on-chip memory utility can be used. to use the resident utility, bootload a three-byte program consisting of a single jump instruction to $bf00. $bf00 is the starting address of a resident eprom programming utility. the utility program sets the x and y index registers to default values, then receives programming data from an external host and puts it in eprom. the value in ix determines programming delay time. the value in iy is a pointer to the first address in eprom to be programmed (default = $d000). when the utility program is ready to receive programming data, it sends the host an $ff character; then it waits. when the host sees the $ff character, the eprom programming data is sent, starting with location $d000. after the last byte to be programmed is sent and the corresponding verification data is returned, the programming operation is terminated by resetting the mcu. 3.6.2 eeprom the 640-byte on-board eeprom is initially located from $0d80 to $0fff after reset in all modes. it can be mapped to any other 4k boundary by writing to the init2 register. the eeprom is enabled by the eeon bit in the config register. programming and erasing is controlled by the pprog register. unlike information stored in rom, data in the 640 bytes of eeprom can be erased and reprogrammed under software control. because programming and erasing operations use an on-chip charge pump driven by v dd , a separate external power supply is not required. an internal charge pump supplies the programming voltage. use of the block protect register (bprot) prevents inadvertent writes to (or erases of) blocks of eeprom (see bprot ? block protect register ). the csel bit in the option register selects an on-chip oscillator clock for programming and erasing while operating at frequencies below 2mhz. refer to resets and interrupts . in special modes there two extra rows and columns of eeprom, which are used for factory testing. endurance and data retention specifications do not apply to these cells. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory eprom, eeprom and config register mc68hc11p2 ? rev 1.0 technical data operating modes and on-chip memory 3.6.2.1 pprog ? eeprom programming control register note: writes to eeprom addresses are inhibited while eepgm is one. a write to a different eeprom location is prevented while a program or erase operation is in progress. odd ? program odd rows in half of eeprom (test) even ? program even rows in half of eeprom (test) if both odd and even are set to one then all odd and even rows in half of the eeprom will be programmed with the same data, within one programming cycle. bit 5 ? not implemented; always reads zero. byte ? eeprom byte erase mode 1 = erase only one byte of eeprom. 0 = row or bulk erase mode used. row ? eeprom row/bulk erase mode (only valid when byte = 0) 1 = erase only one 16 byte row of eeprom. 0 = erase all 640 bytes of eeprom. erase ? erase/normal control for eeprom 1 = erase mode. 0 = normal read or program mode. addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset eeprom programming (pprog) $003b odd even 0 byte row eras e eelat eepg m 0000 0000 table 3-8. erase mode selection byte row action 0 0 bulk erase (all 640 bytes) 0 1 row erase (16 bytes) 1 0 byte erase 1 1 byte erase f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory technical data mc68hc11p2 ? rev 1.0 operating modes and on-chip memory eelat ? eeprom latch control 1 = eeprom address and data bus set up for programming or erasing. 0 = eeprom address and data bus set up for normal reads. when the eelat bit is cleared, the eeprom can be read as if it were a rom. the block protect register has no effect during reads. eepgm ? eeprom program command 1 = program or erase voltage switched on to eeprom array. 0 = program or erase voltage switched off to eeprom array. during eeprom programming, the row and byte bits of pprog are not used. if the frequency of the e clock is 1mhz or less, set the csel bit in the option register. remember that zeros must be erased by a separate erase operation before programming. the following example of how to program an eeprom byte assumes that the appropriate bits in bprot have been cleared. prog ldab #$02 eelat=1 stab $103b set eelat bit staa $0d80 store data to eeprom address ldab #$03 eelat=eepgm=1 stab $103b turn on programming voltage jsr dly10 delay 10 ms clr $103b turn off high voltage and set to read mode 3.6.2.2 eeprom bulk erase to erase the eeprom, ensure that the proper bits of the bprot register are cleared, then complete the following steps using the pprog register: 1. write to pprog with the erase, eelat and appropriate byte and row bits set. 2. write to the appropriate eeprom address with any data. row erase only requires a write to any location in the row. bulk erase is accomplished by writing to any location in the array. 3. write to pprog with erase, eelat, eepgm and the appropriate byte and row bits set. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory eprom, eeprom and config register mc68hc11p2 ? rev 1.0 technical data operating modes and on-chip memory 6. clear the pprog register to reconfigure the eeprom address and data buses for normal operation. the following is an example of how to bulk erase the 512-byte eeprom. the config register is not affected in this example. bulke ldab #$02 eelat=1 stab $103b set eelat bit staa $0d80 store data to any eeprom address ldab #$03 eelat=eepgm=1 stab $103b turn on programming voltage jsr dly10 delay 10 ms clr $103b turn off high voltage and set to read mode 3.6.2.3 eeprom row erase the following example shows how to perform a fast erase of large sections of eeprom: rowe ldab #$0e row=erase=eelat=1 stab $103b set to row erase mode stab 0,x write any data to any address in row ldab #$0f row=erase=eelat=eepgm=1 stab $103b turn on high voltage jsr dly10 delay 10 ms clr $103b turn off high voltage and set to read mode 3.6.2.4 eeprom byte erase the following is an example of how to erase a single byte of eeprom: bytee ldab #$16 byte=erase=eelat=1 stab $103b set to byte erase mode stab 0,x write any data to address to be erased ldab #$17 byte=erase=eelat=eepgm=1 stab $103b turn on high voltage jsr dly10 delay 10 ms clr $103b turn off high voltage and set to read mode f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory technical data mc68hc11p2 ? rev 1.0 operating modes and on-chip memory 3.6.3 config register programming because the config register is implemented with eeprom cells, use eeprom procedures to erase and program this register. the procedure for programming is the same as for programming a byte in the eeprom array, except that the config register address is used. config can be programmed or erased (including byte erase) while the mcu is operating in any mode, provided that ptcon in bprot is clear. to change the value in the config register, complete the following procedure. do not initiate a reset until the procedure is complete. 1. erase the config register. 2. program the new value to the config address. 3. initiate reset. config ? system configuration register for a description of the bits contained in the config register refer to config ? system configuration register . config is made up of eeprom cells and static working latches. the operation of the mcu is controlled directly by these latches and not the eeprom byte. when programming the config register, the eeprom byte is accessed. when the config register is read, the static latches are accessed. these bits can be read at any time. the value read is the one latched into the register from the eeprom cells during the last reset sequence. a new value programmed into this register is not readable until after a subsequent reset sequence. unused bits always read as ones. if smod = 1, config bits can be written at any time. if smod = 0, config bits can only be written using the eeprom programming sequence, and are neither readable nor active until latched via the next addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset configuration control (config) $003f roma d 11 pare n nose c noco p romo n eeon x11x 1xxx f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory eprom, eeprom and config register mc68hc11p2 ? rev 1.0 technical data operating modes and on-chip memory 3.6.4 ram and eeprom security the optional security feature protects the contents of eeprom and ram from unauthorized access. a program, or a key portion of a program, can be protected against duplication. to accomplish this, the protection mechanism restricts operation of protected devices to single chip modes, and thus prevents the memory locations from being monitored externally (single chip modes do not allow visibility of the internal address and data buses). resident programs, however, have unlimited access to the internal eeprom and ram and can read, write, or transfer the contents of these memories. the nosec bit in the config register disables this feature on devices that incorporate it. contact a motorola representative for information on the availability of this feature. if the security feature is present and enabled and bootstrap mode is selected, then the following sequence is performed by the bootstrap program: 1. output $ff on the sci. 2. turn block protect off. clear bprot register. 3. if eeprom is enabled, erase it all. 4. verify that the eeprom is erased; if not, begin sequence again. 5. write $ff to every ram byte. 6. erase the config register. if all the above operations are successful, the bootloading process continues as if the device has not been secured. config ? system configuration register for a description of the other bits contained in the config register refer addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset configuration control (config) $003f roma d 11paren nose c noco p romo n eeon x11x 1xxx f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory technical data mc68hc11p2 ? rev 1.0 operating modes and on-chip memory nosec ? eeprom security disabled 1 = disable security. 0 = enable security. note: mc68hc11p2 devices are normally manufactured with nosec set to one and the security option is unavailable. on special request, a mask option is selected during fabrication that enables the security mode. on these parts, the secure mode is invoked by programming the nosec bit to zero. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc11p2 ? rev 1.0 technical data parallel input/output technical data ? mc68hc11p2 section 4. parallel input/output 4.1 contents 4.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 4.3 port a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 4.4 port b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 4.5 port c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 4.6 port d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 4.7 port e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 4.8 port f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 4.9 port g . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 4.10 port h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 4.11 internal pull-up/pull-down resistors . . . . . . . . . . . . . . . . . . . 83 4.12 system configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 4.2 introduction the mc68hc11p2 has up to 54 input/output lines and 8 input-only lines, depending on the operating mode. to enhance the i/o functions, the data bus of this microcontroller is nonmultiplexed. the following table is a summary of the configuration and features of each port. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
parallel input/output technical data mc68hc11p2 ? rev 1.0 parallel input/output note: do not confuse pin function with the electrical state of that pin at reset. all general-purpose i/o pins that are configured as inputs at reset are in a high-impedance state and the contents of the port data registers are undefined; in port descriptions, a ? u ? indicates this condition. the pin function is mode dependent. 4.3 port a port a is an 8-bit bidirectional port, with both data and data direction registers. in addition to their i/o capability, port a pins are shared with timer functions, as shown in the following table. on reset the pins are configured as general purpose high-impedance inputs. table 4-1. port configuration port input pins output pins bidirectional pins alternate functions a ?? 8timer b ?? 8 high order address c ?? 8 data bus d ?? 6 spi and sci1 e8 ?? a/d converter f ?? 8 low order address g ?? 8r/w on pg7 h ?? 8 pwm and sci2/3 (with mi bus) pin alternate function pa0 ic3 pa1 ic2 pa2 ic1 pa3 oc5 and/or oc1, or ic4 pa4 oc4 and/or oc1 pa5 oc3 and/or oc1 pa6 oc2 and/or oc1 pa7 pai and/or oc1               see timing system for more information. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
parallel input/output port b mc68hc11p2 ? rev 1.0 technical data parallel input/output 4.3.1 porta ? port a data register this is a read/write register and is not affected by reset. the bits may be read and written at any time, but, when a pin is allocated to its alternate function, a write to the corresponding register bit has no affect on the pin state. 4.3.2 ddra ? data direction register for port a dda[7:0] ? data direction for port a 1 = the corresponding pin is configured as an output. 0 = the corresponding pin is configured as an input. 4.4 port b port b is an 8-bit bidirectional port, with both data and data direction registers. in addition to their i/o capability, port b pins are used as the nonmultiplexed high order address pins, as shown in the following table. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset port a data (porta) $0000 pa7 pa6 pa5 pa4 pa3 pa2 pa1 pa0 undefined addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset data direction a (ddra) $0001 dda7 dda6 dda5 dda4 dda3 dda2 dda1 dda0 0000 0000 pin alternate function pb0 a8 pb1 a9 pb2 a10 pb3 a11 pb4 a12 pb5 a13 pb6 a14 ? ? ? ? ? ? ? ? ? ? ? ? ? in expanded or test mode, the pins become the high order address and port b is not included in the memory map. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
parallel input/output technical data mc68hc11p2 ? rev 1.0 parallel input/output the state of the pins on reset is mode dependent. in single chip or bootstrap mode, port b pins are high-impedance inputs with selectable internal pull-up resistors (see internal pull-up/pull-down resistors ). in expanded or test mode, port b pins are high order address outputs and portb/ddrb are not in the memory map. 4.4.1 portb ? port b data register the bits may be read and written at any time and are not affected by reset. 4.4.2 ddrb ? data direction register for port b ddb[7:0] ? data direction for port b 1 = the corresponding pin is configured as an output. 0 = the corresponding pin is configured as an input. addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset port b data (portb) $0004 pb7 pb6 pb5 pb4 pb3 pb2 pb1 pb0 undefined addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset data direction b (ddrb) $0002 ddb7 ddb6 ddb5 ddb4 ddb3 ddb2 ddb1 ddb0 0000 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
parallel input/output port c mc68hc11p2 ? rev 1.0 technical data parallel input/output 4.5 port c port c is an 8-bit bidirectional port, with both data and data direction registers. in addition to their i/o capability, port c pins are used as the nonmultiplexed data bus pins, as shown in the following table. the state of the pins on reset is mode dependent. in single chip or bootstrap mode, port c pins are high-impedance inputs. in expanded or test modes, port c pins are the data bus i/o and portc/ddrc are not in the memory map. 4.5.1 portc ? port c data register the bits may be read and written at any time and are not affected by reset. pin alternate function pc0 d0 pc1 d1 pc2 d2 pc3 d3 pc4 d4 pc5 d5 pc6 d6 pc7 d7 ? ? ? ? ? ? ? ? ? ? ? ? ? ? in expanded or test mode, the pins become the data bus and port c is not included in the memory map. addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset port c data (portc) $0006 pc7 pc6 pc5 pc4 pc3 pc2 pc1 pc0 undefined f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
parallel input/output technical data mc68hc11p2 ? rev 1.0 parallel input/output 4.5.2 ddrc ? data direction register for port c ddc[7:0] ? data direction for port c 1 = the corresponding pin is configured as an output. 0 = the corresponding pin is configured as an input. 4.6 port d port d is a 6-bit bidirectional port, with both data and data direction registers. in addition to their i/o capability, port d pins are shared with sci and spi functions, as shown in the following table. on reset the pins are configured as general purpose high-impedance inputs. 4.6.1 portd ? port d data register this is a read/write register and is not affected by reset. the bits may be read and written at any time, but, when a pin is allocated to its alternate addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset data direction c (ddrc) $0007 ddc7 ddc6 ddc5 ddc4 ddc3 ddc2 ddc1 ddc0 0000 0000 pin alternate function pd0 rxd1 pd1 txd1 pd2 miso pd3 mosi pd4 sck pd5 ss see serial peripheral interface (spi) for more information. see serial communications interface (sci) for more information. ? ? ? ? ? ? ? addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset port d data (portd) $0008 0 0 pd5 pd4 pd3 pd2 pd1 pd0 undefined f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
parallel input/output port e mc68hc11p2 ? rev 1.0 technical data parallel input/output 4.6.2 ddrd ? data direction register for port d bits [7:6] ? reserved; always read zero ddd[5:0] ? data direction for port d 1 = the corresponding pin is configured as an output. 0 = the corresponding pin is configured as an input. 4.7 port e port e is an 8-bit input-only port. in addition to their input capability, port e pins are shared with a/d functions, as shown in the following table. on reset the pins are configured as general purpose high-impedance inputs. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset data direction d (ddrd) $0009 0 0 ddd5 ddd4 ddd3 ddd2 ddd1 ddd0 0000 0000 pin alternate function pe0 ad0 pe1 ad1 pe2 ad2 pe3 ad3 pe4 ad4 pe5 ad5 pe6 ad6 pe7 ad7 ? ? ? ? ? ? ? ? ? ? ? ? ? ? see analog-to-digital converter for more information. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
parallel input/output technical data mc68hc11p2 ? rev 1.0 parallel input/output 4.7.1 porte ? port e data register this is a read-only register and is not affected by reset. the bits may be read at any time. note: as port e shares pins with the a/d converter, a read of the this register may affect any conversion currently in progress, if it coincides with the sample portion of the conversion cycle. hence, normally port e should not be read during the sample portion of any conversion. 4.8 port f port f is an 8-bit bidirectional port, with both data and data direction registers. in addition to their i/o capability, port f pins are used as the non-multiplexed low order address pins, as shown in the following table. the state of the pins on reset is mode dependent. in single chip or bootstrap mode, port f pins are high-impedance inputs with selectable internal pull-up resistors (see internal pull-up/pull-down resistors ). in expanded or test modes, port f pins are low order address outputs and portf/ddrf are not in the memory map. addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset port e data (porte) $000a pe7 pe6 pe5 pe4 pe3 pe2 pe1 pe0 undefined pin alternate function pf0 a0 pf1 a1 pf2 a2 pf3 a3 pf4 a4 pf5 a5 pf6 a6 pf7 a7               in expanded or test mode, the pins become the low order address and port f is not included in the memory map. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
parallel input/output port g mc68hc11p2 ? rev 1.0 technical data parallel input/output 4.8.1 portf ? port f data register the bits may be read and written at any time and are not affected by reset. 4.8.2 ddrf ? data direction register for port f ddf[7:0] ? data direction for port f 1 = the corresponding pin is configured as an output. 0 = the corresponding pin is configured as an input. 4.9 port g port g is an 8-bit bidirectional port, with both data and data direction registers. in addition to its i/o capability, port g pin 7 (pg7) is used as the r/w pin in expanded and test modes. the state of pg7 on reset is mode dependent. in single chip or bootstrap mode, pg7 is a high-impedance input. in expanded or test modes, pg7 is the r/w output. the remaining pins (pg[6:0]) are high-impedance inputs, with software selectable internal pull-up resistors (see internal pull-up/pull-down resistors ). addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset port f data (portf) $0005 pf7 pf6 pf5 pf4 pf3 pf2 pf1 pf0 undefined address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset data direction f (ddrf) $0003 ddf7 ddf6 ddf5 ddf4 ddf3 ddf2 ddf1 ddf0 0000 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
parallel input/output technical data mc68hc11p2 ? rev 1.0 parallel input/output 4.9.1 portg ? port g data register the bits may be read and written at any time and are not affected by reset. 4.9.2 ddrg ? data direction register for port g ddg[7:0] ? data direction for port g 1 = the corresponding pin is configured as an output. 0 = the corresponding pin is configured as an input. 4.10 port h port h is an 8-bit bidirectional port, with both data and data direction registers. in addition to their i/o capability, port h pins are shared with sci/mi bus and pwm functions, as shown in the following table. on reset the pins are configured as general purpose high-impedance addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset port g data (portg) $007e pg7 pg6 pg5 pg4 pg3 pg2 pg1 pg0 undefined addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset data direction g (ddrg) $007f ddg7 ddg6 ddg5 ddg4 ddg3 ddg2 ddg1 ddg0 0000 0000 pin alternate function ph0 pw1 ph1 pw2 ph2 pw3 ph3 pw4 ph4 rxd2 ph5 txd2 ph6 rxd3 ph7 txd3 see timing system for more information. ? ? ? ? ? ? ? ? ? ? see serial communications interface (sci) and motorola interconnect bus (mi bus) for more information. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
parallel input/output internal pull-up/pull-down resistors mc68hc11p2 ? rev 1.0 technical data parallel input/output ups on pins 7 ? 4 and pull-downs on pins 3 ? 0 (see internal pull-up/pull- down resistors ). 4.10.1 porth ? port h data register this is a read/write register and is not affected by reset. the bits may be read and written at any time, but, when a pin is allocated to its alternate function, a write to the corresponding register bit has no affect on the pin state. 4.10.2 ddrh ? data direction register for port h ddh[7:0] ? data direction for port h 1 = the corresponding pin is configured as an output. 0 = the corresponding pin is configured as an input. 4.11 internal pull-up/pull-down resistors three of the ports (b, f and g) have internal, software selectable pull-up resistors. port h has both pull-up and pull-down resistors, as described below. addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset port h data (porth) $007c ph7 ph6 ph5 ph4 ph3 ph2 ph1 ph0 undefined address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset data direction h (ddrh) $007d ddh7 ddh6 ddh5 ddh4 ddh3 ddh2 ddh1 ddh0 0000 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
parallel input/output technical data mc68hc11p2 ? rev 1.0 parallel input/output 4.11.1 ppar ? port pull-up assignment register bits [7:4] ? not implemented; always read zero xppue ? port x pin pull-up enable these bits control the on-chip pull-up devices connected to all the pins on i/o ports b, f, g and h. they are collectively enabled or disabled via the paren bit in the config register (see below). 1 = port x pin on-chip pull-up devices enabled. 0 = port x pin on-chip pull-up devices disabled. note: port h [7:4] have pull-up resistors; port h [3:0] have pull-down resistors. all eight internal resistors are enabled if hppue is set. note: fppue and bppue have no effect in expanded mode since ports f and b are dedicated address bus outputs. 4.12 system configuration one bit in each of the following registers is directly concerned with the configuration of the i/o ports. for full details on the other bits in the registers, refer to the appropriate section. 4.12.1 opt2 ? system configuration options register 2 lirdv ? lir driven (refer to operating modes and on-chip memory ) 1 = enable lir drive high pulse. 0 = lir only driven low ? requires pull-up on pin. addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset port pull-up assignment (ppar)$002c0000hppuegppuefppue bppue 0000 1111 addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset system config. options 2 (opt2) $0038 lirdv cwomstrch irvne lsbf spr2 0 0 000x 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
parallel input/output system configuration mc68hc11p2 ? rev 1.0 technical data parallel input/output cwom ? port c wired-or mode 1 = port c outputs are open-drain. 0 = port c operates normally. strch ? stretch external accesses (refer to operating modes and on-chip memory ) 1 = off-chip accesses are extended by one e clock cycle. 0 = normal operation. irvne ? internal read visibility/not e (refer to operating modes and on-chip memory ) 1 = data from internal reads is driven out of the external data bus. 0 = no visibility of internal reads on external bus. in single chip mode this bit determines whether the e clock drives out from the chip. 1 = e pin is driven low. 0 = e clock is driven out from the chip. lsbf ? lsb first enable (refer to serial peripheral interface (spi) ) 1 = data is transferred lsb first. 0 = data is transferred msb first. spr2 ? spi clock rate select (refer to serial peripheral interface (spi) ) bits 1, 0 ? not implemented; always read zero. 4.12.2 config ? system configuration register romad ? rom mapping control (refer to operating modes and on- chip memory ) 1 = rom addressed from $8000 to $ffff. 0 = rom addressed from $0000 to $7fff (expanded mode only). address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset configuration control (config) $003f romad 1 1 parennosecnocopromon eeon x11x 1xxx f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
parallel input/output technical data mc68hc11p2 ? rev 1.0 parallel input/output paren ? pull-up assignment register enable 1 = ppar register enabled; pull-ups can be enabled using ppar. 0 = ppar register disabled; all pull-ups disabled. nosec ? eeprom security disabled (refer to operating modes and on-chip memory ) 1 = disable security. 0 = enable security. nocop ? cop system disable (refer to resets and interrupts ) 1 = cop system disabled. 0 = cop system enabled (forces reset on timeout). romon ? rom enable (refer to operating modes and on-chip memory ) 1 = rom present in the memory map. 0 = rom disabled from the memory map. eeon ? eeprom enable (refer to operating modes and on-chip memory ) 1 = eeprom is present in the memory map. 0 = eeprom is disabled from the memory map. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc11p2 ? rev 1.0 technical data serial communications interface (sci) technical data ? mc68hc11p2 section 5. serial communications interface (sci) 5.1 contents 5.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 5.3 data format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 5.4 transmit operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 5.5 receive operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 5.6 wakeup feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 5.7 sci error detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 5.8 sci registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 5.9 status flags and interrupts . . . . . . . . . . . . . . . . . . . . . . . . . 101 5.10 additional sci subsystems . . . . . . . . . . . . . . . . . . . . . . . . . 104 5.2 introduction the serial communications interface (sci) is a universal asynchronous receiver transmitter (uart). it has a non-return to zero (nrz) format (one start, eight or nine data, and one stop bit) that is compatible with standard rs-232 systems. the mc68hc11p2 contains three serial communications interfaces, all having similar operation. for ease of reference, a full description of sci1 (pd0/rxd1, pd1/txd1) is given first, followed by summaries for sci2 and sci3 , detailing their differences. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial communications interface (sci) technical data mc68hc11p2 ? rev 1.0 serial communications interface (sci) the sci shares i/o with two of port d ? s pins: the sci transmit and receive functions are enabled by te and re respectively, in sccr2. the sci features enabled on this mcu include: 13-bit modulus prescaler; idle line detect; receiver-active flag; transmitter and receiver hardware parity. a block diagram of the enhanced baud rate generator is shown in figure 5-1 . see table 5-1 for example baud rate control values. 5.3 data format the serial data format requires the following conditions:  an idle-line condition before transmission or reception of a message.  a start bit, logic zero, transmitted or received, that indicates the start of each character.  data that is transmitted and received least significant bit (lsb) first. pin alternate function pd0 rxd1 pd1 txd1 figure 5-1. sci baud rate generator circuit diagram 13-bit compare sync scbdh/l : sci baud control 13-bit counter 2 internal phase 2 clock receiver baud rate clock 16 transmitter baud rate clock st4xck reset eq f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial communications interface (sci) transmit operation mc68hc11p2 ? rev 1.0 technical data serial communications interface (sci)  a stop bit, logic one, used to indicate the end of a frame. (a frame consists of a start bit, a character of eight or nine data bits, and a stop bit.)  a break (defined as the transmission or reception of a logic zero for some multiple number of frames). selection of the word length is controlled by the m bit of sccr1. 5.4 transmit operation the sci transmitter includes a parallel data register (scdrh/scdrl) and a serial shift register. the contents of the shift register can only be written through the serial data registers. this double buffered operation allows a character to be shifted out serially while another character is waiting in the serial data registers to be transferred into the shift register. the output of the shift register is applied to txd as long as transmission is in progress or the transmit enable (te) bit of serial communication control register 2 (sccr2) is set. the block diagram, figure 5-2 , shows the transmit serial shift register and the buffer logic at the top of the figure. 5.5 receive operation during receive operations, the transmit sequence is reversed. the serial shift register receives data and transfers it to the parallel receive data registers (scdrh/scdrl) as a complete word. this double buffered operation allows a character to be shifted in serially while another character is still in the serial data registers. an advanced data recovery scheme distinguishes valid data from noise in the serial data stream. the data input is selectively sampled to detect receive data, and majority sampling logic determines the value and integrity of each bit. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial communications interface (sci) technical data mc68hc11p2 ? rev 1.0 serial communications interface (sci) loops woms wake + & & & & & ? m ilt pe pt sccr1 10/11-bit tx shift register h8 l 0 7 10/11-bit rx shift register 80 7 tie tcie te rie ilie re rwu sbk sccr2 tdre tc or rdrf idle nf fe pf scsr1 raf scsr2 data recovery rxd1 txd1 receive buffer r8 transmit buffer t8 transmitter control receiver control loops sci interrupt request woms woms m pe pt te sbk wake pe pt re rwu m loops ilt stop start scbdl scbdh rate generator st4xck or rie rie idle ilie rdrf tc tcie tdre tie note: ? = always reads as zero flag control internal data bus clock f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial communications interface (sci) wakeup feature mc68hc11p2 ? rev 1.0 technical data serial communications interface (sci) 5.6 wakeup feature the wakeup feature reduces sci service overhead in multiple receiver systems. software for each receiver evaluates the first character or frame of each message. all receivers are placed in wakeup mode by writing a one to the rwu bit in the sccr2 register. when rwu is set, the receiver-related status flags (rdrf, idle, or, nf, fe, and pf) are inhibited (cannot be set). although rwu can be cleared by a software write to sccr2, to do so would be unusual. normally rwu is set by software and is cleared automatically with hardware. whenever a new message begins, logic alerts the dormant receivers to wake up and evaluate the initial character of the new message. two methods of wakeup are available: idle-line wakeup and address mark wakeup. during idle-line wakeup, a dormant receiver activates as soon as the rxd line becomes idle. in the address mark wakeup, logic one in the most significant bit (msb) of a character activates all sleeping receivers. to use either receiver wakeup method, establish a software addressing scheme to allow the transmitting devices to direct messages to individual receivers or to groups of receivers. this addressing scheme can take any form as long as all transmitting and receiving devices are programmed to understand the same scheme. 5.6.1 idle-line wakeup clearing the wake bit in sccr1 register enables idle-line wakeup mode. in idle-line wakeup mode, all receivers are active (rwu bit in sccr2 = 0) when each message begins. the first frames of each message are addressing frames. each receiver in the system evaluates the addressing frames of a message to determine if the message is intended for that receiver. when a receiver finds that the message is not intended for it, it sets the rwu bit. once set, the rwu control bit disables all but the necessary receivers for the remainder of the message, thus reducing software overhead for the remainder of that message. as soon as an idle line is detected by receiver logic, hardware automatically clears the rwu bit so that the first frames of the next f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial communications interface (sci) technical data mc68hc11p2 ? rev 1.0 serial communications interface (sci) receiver wakeup requires a minimum of one idle frame time between messages, and no idle time between frames within a message. 5.6.2 address-mark wakeup setting the wake bit in sccr1 register enables address-mark wakeup mode. the address-mark wakeup method uses the msb of each frame to differentiate between address information (msb = 1) and actual message data (msb = 0). all frames consist of seven information bits (eight bits if m bit in sccr1 = 1) and an msb which, when set to one, indicates an address frame. the first frames of each message are addressing frames. receiver logic evaluates these marked frames to determine the receivers for which that message is intended. when a receiver finds that the message is not intended for it, it sets the rwu bit. once set, the rwu control bit disables all but the necessary receivers for the remainder of the message, thus reducing software overhead for the remainder of that message. when the next message begins, its first frame will have the msb set which will automatically clear the rwu bit and indicate that this is an addressing frame. this frame is always the first frame received after wakeup because the rwu bit is cleared before the stop bit for the first frame is received. this method of wakeup allows messages to include idle times, however, there is a loss in efficiency due to the extra bit time required for the address bit in each frame. 5.7 sci error detection four error conditions can occur during sci operation. these error conditions are: serial data register overrun, received bit noise, framing, and parity error. four bits (or, nf, fe, and pf) in serial communications status register 1 (scsr1) indicate if one of these error conditions exists. the overrun error (or) bit is set when the next byte is ready to be transferred from the receive shift register to the serial data registers (scdrh/scdrl) and the registers are already full (rdrf bit is set). f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial communications interface (sci) sci registers mc68hc11p2 ? rev 1.0 technical data serial communications interface (sci) the or is cleared when the scsr is read (with or set), followed by a read of the sci data registers. the noise flag (nf) bit is set if there is noise on any of the received bits, including the start and stop bits. the nf bit is not set until the rdrf flag is set. the nf bit is cleared when the scsr is read (with fe equal to one) followed by a read of the sci data registers. when no stop bit is detected in the received data character, the framing error (fe) bit is set. fe is set at the same time as the rdrf. if the byte received causes both framing and overrun errors, the processor only recognizes the overrun error. the framing error flag inhibits further transfer of data into the sci data registers until it is cleared. the fe bit is cleared when the scsr is read (with fe equal to one) followed by a read of the sci data registers. the parity error flag (pf) is set if received data has incorrect parity. the flag is cleared by a read of scsr1 with pe set, followed by a read of scdr. 5.8 sci registers there are eight addressable registers in the sci. scbdh, scbdl, sccr1, and sccr2 are control registers. the contents of these registers control functions and indicate conditions within the sci. the status registers scsr1 and scsr2 contain bits that indicate certain conditions within the sci. scdrh and scdrl are sci data registers. these double buffered registers are used for the transmission and reception of data, and are used to form the 9-bit data word for the sci. if the sci is being used with 7 or 8-bit data, only scdrl needs to be accessed. note that if 9-bit data format is used, the upper register should be written first to ensure that it is transferred to the transmitter shift register with the lower register. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial communications interface (sci) technical data mc68hc11p2 ? rev 1.0 serial communications interface (sci) 5.8.1 scbdh, scbdl ? sci baud rate control registers the contents of this register determine the baud rate of the sci. btst ? baud register test (test mode only) bspl ? baud rate counter split (test mode only) bit 5 ? not implemented; always reads zero sbr[12:0] ? sci baud rate selects use the following formula to calculate sci baud rate. refer to the table of baud rate control values for example rates: where the baud rate control value (br) is the contents of scbdh/l (br = 1, 2, 3,... 8191). br = 0 disables the baud rate generator. for example, to obtain a baud rate of 1200 with a 12mhz crystal, the baud register (scbdh/l) should contain $0138 (see table 5-1 ). note: st4xck may be the output of the pll circuit or it may be the extal input of the mcu. selection is made by the mcs bit in the pllcr (see crystal driver and external clock input (xtal, extal) ). addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset sci 1 baud rate high (scbdh) $0070 btst bspl 0 sbr12 sbr11 sbr10 sbr9 sbr8 0000 0000 sci 1 baud rate low (scbdl) $0071 sbr7 sbr6 sbr5 sbr4 sbr3 sbr2 sbr1 sbr0 0000 0100 sci baud rate st 4 xck 16 2 br () ---------------------------- - = f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial communications interface (sci) sci registers mc68hc11p2 ? rev 1.0 technical data serial communications interface (sci) 5.8.2 sccr1 ? sci control register 1 the sccr1 register provides the control bits that determine word length and select the method used for the wakeup feature. loops ? sci loop mode enable 1 = sci transmit and receive are disconnected from txd and rxd pins, and transmitter output is fed back into the receiver input. 0 = sci transmit and receive operate normally. both the transmitter and receiver must be enabled to use the loop mode. when the loop mode is enabled, the txd pin is driven high (idle line state) if the transmitter is enabled. woms ? wired-or mode for sci pins (pd1, pd0) 1 = txd and rxd are open drains if operating as outputs. 0 = txd and rxd operate normally. table 5-1. example sci baud rate control values target baud rate crystal frequency (extal) 8 mhz 12 mhz 16 mhz dec value hex value dec value hex value dec value hex value 110 2272 $08e0 3409 $0d51 4545 $11c1 150 1666 $0682 2500 $09c4 3333 $0d05 300 833 $0341 1250 $04e2 1666 $0682 600 416 $01a0 625 $0271 833 $0341 1200 208 $00d0 312 $0138 416 $01a0 2400 104 $0068 156 $009c 208 $00d0 4800 52 $0034 78 $004e 104 $0068 9600 26 $001a 39 $0027 52 $0034 19200 13 $000d 20 $0014 26 $001a 38400 13 $000d addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset sci 1 control 1 (sccr1) $0072 loop s woms 0 m wake ilt pe pt 0000 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial communications interface (sci) technical data mc68hc11p2 ? rev 1.0 serial communications interface (sci) m ? mode (select character format) 1 = start bit, 9 data bits, 1 stop bit. 0 = start bit, 8 data bits, 1 stop bit. wake ? wakeup by address mark/idle 1 = wakeup by address mark (most significant data bit set). 0 = wakeup by idle line recognition. ilt ? idle line type 1 = long (sci counts ones only after stop bit). 0 = short (sci counts consecutive ones after start bit). this bit determines which of two types of idle line detection method is used by the sci receiver. in short mode the stop bit and any bits that were ones before the stop bit will be considered as part of that string of ones, possibly resulting in erroneous or premature detection of an idle line condition. in long mode the sci system does not begin counting ones until a stop bit is received. pe ? parity enable 1 = parity enabled. 0 = parity disabled. pt ? parity type 1 = parity odd (an odd number of ones causes parity bit to be zero, an even number of ones causes parity bit to be one). 0 = parity even (an even number of ones causes parity bit to be zero, an odd number of ones causes parity bit to be one). f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial communications interface (sci) sci registers mc68hc11p2 ? rev 1.0 technical data serial communications interface (sci) 5.8.3 sccr2 ? sci control register 2 the sccr2 register provides the control bits that enable or disable individual sci functions. tie ? transmit interrupt enable 1 = sci interrupt requested when tdre status flag is set. 0 = tdre interrupts disabled. tcie ? transmit complete interrupt enable 1 = sci interrupt requested when tc status flag is set. 0 = tc interrupts disabled. rie ? receiver interrupt enable 1 = sci interrupt requested when rdrf flag or the or status flag is set. 0 = rdrf and or interrupts disabled. ilie ? idle line interrupt enable 1 = sci interrupt requested when idle status flag is set. 0 = idle interrupts disabled. te ? transmitter enable 1 = transmitter enabled. 0 = transmitter disabled. re ? receiver enable 1 = receiver enabled. 0 = receiver disabled. rwu ? receiver wakeup control 1 = wakeup enabled and receiver interrupts inhibited. 0 = normal sci receiver. sbk ? send break 1 = break codes generated as long as sbk is set. addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset sci 1 control 2 (sccr2) $0073 tie tcie rie ilie te re rwu sbk 0000 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial communications interface (sci) technical data mc68hc11p2 ? rev 1.0 serial communications interface (sci) 5.8.4 scsr1 ? sci status register 1 the bits in scsr1 indicate certain conditions in the sci hardware and are automatically cleared by special acknowledge sequences. tdre ? transmit data register empty flag 1 = scdr empty. 0 = scdr busy. this flag is set when scdr is empty. clear the tdre flag by reading scsr1 with tdre set and then writing to scdr. tc ? transmit complete flag 1 = transmitter idle. 0 = transmitter busy. this flag is set when the transmitter is idle (no data, preamble, or break transmission in progress). clear the tc flag by reading scsr1 with tc set and then writing to scdr. rdrf ? receive data register full flag 1 = scdr full. 0 = scdr empty. once cleared, idle is not set again until the rxd line has been active and becomes idle again. rdrf is set if a received character is ready to be read from scdr. clear the rdrf flag by reading scsr1 with rdrf set and then reading scdr. idle ? idle line detected flag 1 = rxd line is idle. 0 = rxd line is active. this flag is set if the rxd line is idle. once cleared, idle is not set again until the rxd line has been active and becomes idle again. the idle flag is inhibited when rwu = 1. clear idle by reading scsr1 with idle set and then reading scdr. addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset sci 1 status 1 (scsr1) $0074 tdre tc rdrf idle or nf fe pf 1100 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial communications interface (sci) sci registers mc68hc11p2 ? rev 1.0 technical data serial communications interface (sci) or ? overrun error flag 1 = overrun detected. 0 = no overrun. or is set if a new character is received before a previously received character is read from scdr. clear the or flag by reading scsr1 with or set and then reading scdr. nf ? noise error flag 1 = noise detected. 0 = unanimous decision. nf is set if the majority sample logic detects anything other than a unanimous decision. clear nf by reading scsr1 with nf set and then reading scdr. fe ? framing error 1 = zero detected. 0 = stop bit detected. fe is set when a zero is detected where a stop bit was expected. clear the fe flag by reading scsr1 with fe set and then reading scdr. pf ? parity error flag 1 = incorrect parity detected. 0 = parity correct. pf is set if received data has incorrect parity. clear pf by reading scsr1 with pe set and then reading scdr. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial communications interface (sci) technical data mc68hc11p2 ? rev 1.0 serial communications interface (sci) 5.8.5 scsr2 ? sci status register 2 in the scsr2 only bit 0 is used, to indicate receiver active. the other seven bits always read zero. bits [7:1] ? not implemented; always read zero raf ? receiver active flag (read only) 1 = a character is being received. 0 = a character is not being received. 5.8.6 scdrh, scdrl ? sci data high/low registers scdrh/scdrl is a parallel register that performs two functions. it is the receive data register when it is read, and the transmit data register when it is written. reads access the receive data buffer and writes access the transmit data buffer. data received or transmitted is double buffered. r8 ? receiver bit 8 ninth serial data bit received when sci is configured for a nine data bit operation t8 ? transmitter bit 8 ninth serial data bit transmitted when sci is configured for a nine data bit operation bits [5:0] ? not implemented; always read zero r/t[7:0] ? receiver/transmitter data bits [7:0] sci data is double buffered in both directions. addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset sci 1 status 2 (scsr2)$00750000000raf0000 0000 addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset sci 1 data high (scdrh) $0076 r8 t8 0 0 0 0 0 0 undefined sci 1 data low (scdrl) $0077 r7t7 r6t6 r5t5 r4t4 r3t3 r2t2 r1t1 r0t0 undefined f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial communications interface (sci) status flags and interrupts mc68hc11p2 ? rev 1.0 technical data serial communications interface (sci) 5.9 status flags and interrupts the sci transmitter has two status flags. these status flags can be read by software (polled) to tell when certain conditions exist. alternatively, a local interrupt enable bit can be set to enable each of these status conditions to generate interrupt requests. status flags are automatically set by hardware logic conditions, but must be cleared by software. this provides an interlock mechanism that enables logic to know when software has noticed the status indication. the software clearing sequence for these flags is automatic ? functions that are normally performed in response to the status flags also satisfy the conditions of the clearing sequence. tdre and tc flags are normally set when the transmitter is first enabled (te set to one). the tdre flag indicates there is room in the transmit queue to store another data character in the transmit data register. the tie bit is the local interrupt mask for tdre. when tie is zero, tdre must be polled. when tie and tdre are one, an interrupt is requested. the tc flag indicates the transmitter has completed the queue. the tcie bit is the local interrupt mask for tc. when tcie is zero, tc must be polled; when tcie is one and tc is one, an interrupt is requested. writing a zero to te requests that the transmitter stop when it can. the transmitter completes any transmission in progress before shutting down. only an mcu reset can cause the transmitter to stop and shut down immediately. if te is cleared when the transmitter is already idle, the pin reverts to its general-purpose i/o function (synchronized to the bit-rate clock). if anything is being transmitted when te is cleared, that character is completed before the pin reverts to general-purpose i/o, but any other characters waiting in the transmit queue are lost. the tc and tdre flags are set at the completion of this last character, even though te has been disabled. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial communications interface (sci) technical data mc68hc11p2 ? rev 1.0 serial communications interface (sci) 5.9.1 receiver flags the sci receiver has seven status flags, three of which can generate interrupt requests. the status flags are set by the sci logic in response to specific conditions in the receiver. these flags can be read (polled) at any time by software. refer to figure 5-3 , which shows sci interrupt arbitration. when an overrun takes place, the new character is lost, and the character that was in its way in the parallel receive data register (rdr) is undisturbed. rdrf is set when a character has been received and transferred into the parallel rdr. the or flag is set instead of rdrf if overrun occurs. a new character is ready to be transferred into the rdr before a previous character is read from the rdr. the nf, fe and pf flags provide additional information about the character in the rdr, but do not generate interrupt requests. the receiver active flag (raf) indicates that the receiver is busy. the last receiver status flag and interrupt source come from the idle flag. the rxd line is idle if it has constantly been at logic one for a full character time. the idle flag is set only after the rxd line has been busy and becomes idle. this prevents repeated interrupts for the time rxd remains idle. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial communications interface (sci) status flags and interrupts mc68hc11p2 ? rev 1.0 technical data serial communications interface (sci) figure 5-3. interrupt source resolution within sci no begin rdrf = 1? or = 1? tdre = 1? tc = 1? idle = 1? no valid sci interrupt request rie = 1? te = 1? re = 1? tie = 1? tcie = 1? ilie = 1? re = 1? valid sci interrupt request yes yes yes yes yes yes yes yes yes yes yes yes no no no no no no no no no no no note: the bit names shown are for sci1. the diagram applies equally to sci2 and sci3, when the appropriate bit names are substituted. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial communications interface (sci) technical data mc68hc11p2 ? rev 1.0 serial communications interface (sci) 5.10 additional sci subsystems in addition to the subsystem described in the above paragraphs (sci1), the mc68hc11p2 has two other, similar, sci modules (sci2, sci3). these two systems are identical to that described, with the following exceptions: sci2 and sci3 share i/o with four port h pins: the sci2 transmit and receive functions are enabled by te2 and re2 respectively, in s2cr2; similarly, the sci3 transmit and receive functions are enabled by te3 and re3 respectively, in s3cr2. sci1 functions and data are handled by a register block at $0070 ? $0077. the corresponding registers for sci2 and sci3 are at addresses $0050 ? $0057 and $005a ? $005f respectively, as shown in the following sections. sci2 and sci3 share the same baud rate register (at $0050/51). in addition to their sci functions, these two subsystems are also used for mi bus, controlled by bit 5 of their respective sccr1 registers. refer to motorola interconnect bus (mi bus) for full details of mi bus operation. 5.10.1 sci2 sci2 shares i/o with two of port h ? s pins: receive pin rxd2/ph6 and transmit pin txd2/pd7. the sci receive and transmit functions are enabled by re and te respectively, in s2cr2. pin alternate function ph4 rxd2 ph5 txd2 ph6 rxd3 ph7 txd3 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial communications interface (sci) additional sci subsystems mc68hc11p2 ? rev 1.0 technical data serial communications interface (sci) 5.10.1.1 s2bdh, s2bdl ? sci2/3 baud rate control registers the contents of this register determine the baud rate for both sci2 and sci3. for details of the bits and the corresponding baud rates see scbdh, scbdl ? sci baud rate control registers . this register also controls the mi bus clock rate (see motorola interconnect bus (mi bus) ). 5.10.1.2 s2cr1 ? sci2 control register 1 the s2cr1 register provides the control bits that determine word length and select the method used for the wakeup feature. bit 5 has an mi bus control function detailed below (for details of the other bits see sccr1 ? sci control register 1 ). mie2 ? motorola interface bus enable 2 1 = mi bus is enabled for this subsystem. 0 = the sci functions normally. when mie2 is set, the sci2 registers, bits and pins assume the functionality required for mi bus. 5.10.1.3 s2cr2 ? sci2 control register 2 the s2cr2 register provides the control bits that enable or disable individual sci functions. for details of the bits, see sccr2 ? sci addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset sci/mi 2/3 baud high (s2bdh) $0050 b2tst b2spl 0 s2b12 s2b11 s2b10 s2b9 s2b8 0000 0000 sci/mi 2/3 baud low (s2bdl) $0051 s2b7 s2b6 s2b5 s2b4 s2b3 s2b2 s2b1 s2b0 0000 0100 addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset sci/mi 2 control 1 (s2cr1) $0052 lops2 woms 2 mie2 m2 wake 2 ilt2 pe2 pt2 0000 0000 addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset sci/mi 2 control 2 (s2cr2) $0053 tie2 tcie2 rie2 ilie2 te2 re2 rwu2 sbk2 0000 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial communications interface (sci) technical data mc68hc11p2 ? rev 1.0 serial communications interface (sci) 5.10.1.4 s2sr1 ? sci2 status register 1 the bits in s2sr1 indicate certain conditions in the sci hardware and are automatically cleared by special acknowledge sequences. for details of the bits, see scsr1 ? sci status register 1 . 5.10.1.5 s2sr2 ? sci2 status register 2 in the s2sr2 only bit 0 is used, to indicate receiver active (see scsr2 ? sci status register 2 ). the other seven bits always read zero. 5.10.1.6 s2drh, s2drl ? sci2 data high/low registers s2drh/s2drl is a parallel register that performs two functions. it is the receive data register when it is read, and the transmit data register when it is written. reads access the receive data buffer and writes access the transmit data buffer. data received or transmitted is double buffered. see scdrh, scdrl ? sci data high/low registers for more details. 5.10.2 sci3 sci3 shares i/o with two of port h ? s pins: receive pin rxd3/ph4 and transmit pin txd3/pd5. the sci receive and transmit functions are enabled by re and te respectively, in s3cr2. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset sci/mi 2 status 1 (s2sr1) $0054 tdre2 tc2 rdrf2 idle2 or2 nf2 fe2 pf2 1100 0000 addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset sci/mi 2 status 2 (s2sr2)$00550000000raf20000 0000 addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset sci/mi 2 data high (s2drh) $0056 r8b t8b 0 0 0000 undefined sci/mi 2 data low (s2drl) $0057 r7t7b r6t6b r5t5b r4t4b r3t3b r2t2b r1t1b r0t0b undefined f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial communications interface (sci) additional sci subsystems mc68hc11p2 ? rev 1.0 technical data serial communications interface (sci) 5.10.2.1 s3cr1 ? sci3 control register 1 the s3cr1 register provides the control bits that determine word length and select the method used for the wakeup feature. bit 5 has an mi bus control function detailed below (for details of the other bits see sccr1 ? sci control register 1 ). mie3 ? motorola interface bus enable 3 1 = mi bus is enabled for this subsystem. 0 = the sci functions normally. when mie3 is set, the sci3 registers, bits and pins assume the functionality required for mi bus. 5.10.2.2 s3cr2 ? sci3 control register 2 the s3cr2 register provides the control bits that enable or disable individual sci functions. for details of the bits, see sccr2 ? sci control register 2 . 5.10.2.3 s3sr1 ? sci3 status register 1 the bits in s3sr1 indicate certain conditions in the sci hardware and are automatically cleared by special acknowledge sequences. for details of the bits, see scsr1 ? sci status register 1 . addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset sci/mi 3 control 1 (s3cr1) $005a lops3 woms3 mie3 m3 wake3 ilt3 pe3 pt3 0000 0000 addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset sci/mi 3 control 2 (s3cr2) $005b tie3 tcie3 rie3 ilie3 te3 re3 rwu3 sbk3 0000 0000 addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset sci/mi 3 status 1 (s3sr1) $005c tdre3 tc3 rdrf3 idle3 or3 nf3 fe3 pf3 1100 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial communications interface (sci) technical data mc68hc11p2 ? rev 1.0 serial communications interface (sci) 5.10.2.4 s3sr2 ? sci3 status register 2 in s3sr2 only bit 0 is used, to indicate receiver active (see scsr2 ? sci status register 2 for details). the other seven bits always read zero. 5.10.2.5 s3drh, s3drl ? sci3 data high/low registers s3drh/s3drl is a parallel register that performs two functions. it is the receive data register when it is read, and the transmit data register when it is written. reads access the receive data buffer and writes access the transmit data buffer. data received or transmitted is double buffered. see scdrh, scdrl ? sci data high/low registers for more details. addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset sci/mi 3 status 2 (s3sr2) $005d 0 0 0 0 0 0 0 raf3 0000 0000 addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset sci/mi 3 data high (s3drh)$005er8ct8c000000undefined sci/mi 3 data low (s3drl) $005f r7t7c r6t6c r5t5c r4t4c r3t3c r2t2c r1t1c r0t0c undefined f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc11p2 ? rev 1.0 technical data motorola interconnect bus (mi bus) technical data ? mc68hc11p2 section 6. motorola interconnect bus (mi bus) 6.1 contents 6.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 6.3 push-pull sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 6.4 the push field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 6.5 the pull field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 6.6 biphase coding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 6.7 message validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 6.8 interfacing to mi bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 6.9 mi bus clock rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 6.10 sci/mi bus2 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 6.11 sci/mi bus3 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 6.2 introduction the motorola interconnect bus (mi bus) is a serial communications protocol which supports distributed real-time control efficiently and with a high degree of noise immunity, at a typical bit rate for the data transfer of 20khz. the mi bus is suitable for medium speed networks requiring very low cost multiplex wiring; only one wire is required to connect to slave devices. (1) 1. related information on motorola ? s mi bus is contained in the following motorola publications: f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola interconnect bus (mi bus) technical data mc68hc11p2 ? rev 1.0 motorola interconnect bus (mi bus) the mc68hc11p2 contains two similar mi bus modules. for ease of reference, a full description of mi bus2 is given, followed by a summary of mi bus3, detailing its differences. the mi bus uses a push-pull sequence to transfer data. the master device, which, in this case, is the mc68hc11p2, sends a push field to the slave devices connected to the bus. the push field contains data plus an address that is recognized by one of the slaves. the slave addressed returns data which the master pulls from the mi bus over the same wire. specific details of the message format are covered later in this section. the mcu (master) can take the bus at any time, with a start bit that violates the rules of manchester biphase encoding. up to eight slave devices may be addressed by the mi bus. other features of mi bus include message validation, error detection, and default value setting. on the mc68hc11p2 the mi bus module shares the same pins on port h as the sci2 and sci3 modules. data is transmitted (or ? pushed ? ) via the txd pin, and received ( ? pulled ? ) via the rxd pin. while data is being pushed rxd will be disconnected from the receiver circuitry. the message frame is handled automatically in hardware. the mcu register interface is similar to that for the sci. mi bus2 functions are enabled by mie2 in s2cr1; mi bus3 functions by mie3 in s3cr1. pin alternate function ph4 rxd2 ph5 txd2 ph6 rxd3 ph7 txd3 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola interconnect bus (mi bus) push-pull sequence mc68hc11p2 ? rev 1.0 technical data motorola interconnect bus (mi bus) 6.3 push-pull sequence communication between the mcu and the slave device always utilizes the same frame organization. first, the mcu sends serial data to the selected device. this data field is called the ? push field ? . at the end of the push field, the selected device automatically sends back to the mcu the data held during the push sequence. the mcu reads the serial data sent by the selected device. this data is called the ? pull field ? and contains status information followed by the end-of-frame information from the selected device. figure 6-1. mi bus timing 10 01 1 0 234 67 5 start stop start push sync d0 d1 d2 d3 d4 a0 a1 a2 pull sync s3 s2 s1 data address nrz data end of frame push field (driven by mcu) pull field (driven by slave) message frame push (biphase coded) pull (nrz coded) new frame push-pull function time slots txd pin (true data) mi bus wire bit fields f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola interconnect bus (mi bus) technical data mc68hc11p2 ? rev 1.0 motorola interconnect bus (mi bus) 6.4 the push field the push field consists of a start bit, a push synchronization bit, a push data field and a push address field. the start consists of three time slots having the dominant logical state ? 0 ? . the start marks the beginning of the message frame by violation of the rule of the manchester code. the push synchronization bit consists of a biphase coded ? 0 ? . biphase coding will be discussed later. the push data field consists of five bits of biphase coded data. the push address consists of three bits of biphase coded data. data and address are written to the lower byte of the sci data register (s2drl). the push data occupies the lower five bits and the push address occupies the upper three bits of the register. 6.5 the pull field the pull field consists of a pull synchronization bit, a pull data field and an end of frame. the pull synchronization bit is a biphase coded ? 1 ? and is initiated by the mcu during the time slot after the last address bit of the push field. the pull data field consists of an nrz coded transmission, each bit taking one time slot. once shifted in, the pull data is stored in the lower byte of the sci data register (s2drl). the end-of-frame field is a square wave signal having a typical frequency of 20khz 1% tolerance (i.e. the bit rate of the push field) when the data sent to the selected device is valid. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola interconnect bus (mi bus) biphase coding mc68hc11p2 ? rev 1.0 technical data motorola interconnect bus (mi bus) 6.6 biphase coding manchester biphase l coding is used for the push field bits. each bit requires two time slots to encode the logic value of the bit. this encoding allows the detection of a single error at the time slot level. bits are encoded as follows: 1 = in the first time slot, the logic level is set to zero, followed by a logic level one in the second time slot; 0 = in the first time slot, the logic level is set to one, followed by a logic level zero in the second time slot. 6.7 message validation the communication between the mcu and the selected device is valid when the mcu reads a pull data field having correct codes (excluding the codes ? 111 ? and ? 000 ? ) followed by a square wave signal, having a frequency of 20khz, contained in the end-of-frame information. an mi bus error is detected when the pull field contains the code ? 111 ? followed by the end-of-frame permanently tied to logical state ? 1 ? . this means that the communication between the mcu and the selected device was not accomplished. figure 6-2. biphase coding and error detection ?0? ?1? 01234567 01234567 t biphase coded signal biphase detection noise detection abab a ? b ? aba ? b ? ab f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola interconnect bus (mi bus) technical data mc68hc11p2 ? rev 1.0 motorola interconnect bus (mi bus) 6.7.1 controller detected errors there are three different mi bus error types which are detected by the selected slave device and are not mutually exclusive. the mcu cannot determine which error occurred. noise error slave devices take two samples in each time slot of the biphase encoded push field. an error occurs when the two samples for each time slot are not the same logical level. biphase error slave devices receiving the push field detect the biphase code. an error occurs when the two time slots of the biphase code do not yield a logical exclusive-or function. field error a field error is detected when the fixed-form of the push field is violated. 6.7.2 mcu detected errors there is a fourth error that can be detected by the mcu. this error causes the noise flag (nf) to be asserted in the s2sr1 (or s3sr1) register during the push field sequence. bit error a bit error can be detected by the mcu during the push field. the mi bus serial system monitors the bus via on-chip hardware at the rxd pin at the same time as sending data. a bit error is detected at that bit time when the value monitored is different from the bit value sent. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola interconnect bus (mi bus) message validation mc68hc11p2 ? rev 1.0 technical data motorola interconnect bus (mi bus) lops2 woms2 wake2 + & & & & & m2 ilt2 pe2 pt2 s2cr1 10/11-bit tx shift register h8 l 0 7 10/11-bit rx shift register 80 7 tie2 te2 rie2 ilie2 re2 rwu2 sbk2 s2cr2 tdre2 tc2 or2 rdrf2 s2sr1 raf2 s2sr2 data recovery rxd2 txd2 receive buffer r8 transmit buffer t8 transmitter control receiver control sci interrupt request woms woms mie2 pt2 te2 sbk2 mie2 re2 stop start s2bdl s2bdh rate generator st4xck or2 rie2 rie2 idle2 ilie2 rdrf2 tc2 tcie2 tdre2 tie2 note: ? = always reads as zero flag control internal data bus mie2 ? ? ? tcie2 nf2 = not used in mi bus mode clock f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola interconnect bus (mi bus) technical data mc68hc11p2 ? rev 1.0 motorola interconnect bus (mi bus) 6.8 interfacing to mi bus physically the mi bus consists of only a single wire. in the example shown in figure 6-4 , only a single transistor and a few passive components are required to connect up the mc68hc11p2 for full mi bus operation. the transistor serves both to drive the mi bus during the push field and to protect the mcu tx pin from voltage transients generated in the wiring. without the transistor, emi could damage the tx pin. similarly, the input pin (rx) is protected from emi by clamping it to the mcu supply rails with two diodes. when a load dump occurs, the zener diode (18v) is switched on and hence turns the transistor on; this generates the logic ? 0 ? state on the mi bus. after eight time slots (200ms) of continuous ? 0 ? state, all devices on the mi bus will have their outputs disabled. figure 6-4. a typical interface between the mc68hc11p2 and the mi bus 1.2k ? +12v 18v 4.7k ? 3.9k ? 10k ? mi bus tx rx mcu v dd v dd t1 v dd v ss 10k ? 22k ? f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola interconnect bus (mi bus) mi bus clock rate mc68hc11p2 ? rev 1.0 technical data motorola interconnect bus (mi bus) the mi bus line can take two states, recessive or dominant. the recessive state ( ? 1 ? ) is represented by 5v, through a pull-up resistor of 10k ? . the dominant state ( ? 0 ? ) is represented by a maximum 0.3v (v cesat of the transistor, t1). the bus load depends on the number of devices on the bus. each device has a pull-up resistor of 10k ? . an external termination resistor is used to stabilize the load resistance of the bus at 600 ? . 6.9 mi bus clock rate the mi bus clock rate is set via the sci baud registers. to use the mi bus the st4xck clock frequency that drives the sci clock generator must be selected to match the minimum resolution of the mi bus logic. this is expressed by the following formula: st4xck = 16  2n  (2  push_field_bit_rate) = 16  2n  40khz = n  1280khz where ? n ? is an integer and 20khz is the minimum push field bit rate for the mi bus. values for st4xck could be 1280khz, 2560khz, ? , n  1280khz. the value ? n ? is the modulus for the mi bus baud register (see s2bdh, s2bdl ? mi bus clock rate control registers ). the st4xck may be the output of the pll circuit or it may be the extal input of the mcu. this selection is made by setting the mcs bit which is described in pllcr ? pll control register . 6.10 sci/mi bus2 registers mi bus operation is controlled by the same group of registers as is used for the sci. however the function of some of the bits is modified when in mi bus mode. a description of the registers, as applicable to the mi bus function, is given here. note: bits that have no meaning in mi bus mode are shown shaded to avoid confusion. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola interconnect bus (mi bus) technical data mc68hc11p2 ? rev 1.0 motorola interconnect bus (mi bus) 6.10.1 init2 ? eeprom mapping and mi bus delay register this register sets the mi bus delay time. init2 may be read at any time but bits 7 ? 4 may be written only once after reset in normal modes (bits 3 ? 0 may be written at any time). ee[3:0] ? eeprom map position eeprom is located at $xd80 ? $xfff, where x is the hexadecimal digit represented by ee[3:0]. refer to init2 ? eeprom mapping and mi bus delay register . m3dl1:m3dl0, m2dl1:m2dl0 ? mi bus delay select these bits are used to set up the delay for the start of the nrz receive for mi bus operation as shown (for a 20khz bit rate) in the following table. each mi bus module is controlled by one pair of bits. addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset eeprom mapping (init2) $0037 ee3 ee2 ee1 ee0 m3dl1 m3dl0 m2dl1 m2dl0 0000 0000 mxdl1 mxdl0 delay factor delay time (1) 1. 20khz bit rate requires 25s (40khz) time slots. 00 1 1.5625s (2) 2. 25s 16 0 1 2 3.1250s 1 0 3 4.6875s 1 1 4 6.2500s f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola interconnect bus (mi bus) sci/mi bus2 registers mc68hc11p2 ? rev 1.0 technical data motorola interconnect bus (mi bus) 6.10.2 s2bdh, s2bdl ? mi bus clock rate control registers the contents of this register determine the clock rate for both mi bus 2 and mi bus 3. s2b[12:0] ? sci baud rate/ mi bus clock rate selects use the following formula to calculate mi bus 2/3 clock rate. refer to the table of baud rate control values ( table 5-1 ) for example rates: where the baud rate control value (br) is the contents of s2bdh/l (br = 1, 2, 3,... 8191). br = 0 disables the clock rate generator. 6.10.3 s2cr1 ? mi bus2 control register 1 woms2 ? wired-or mode for mi bus2 pins (ph4, ph5) 1 = txd2 and rxd2 are open drains if operating as outputs. 0 = txd2 and rxd2 operate normally. mie2 ? motorola interface bus enable 2 1 = mi bus is enabled for this subsystem. 0 = the sci functions normally. when mie2 is set, the sci2 registers, bits and pins assume the functionality required for mi bus. pt2 ? mi bus tx polarity 1 = mi bus transmit pin will send inverted data. 0 = mi bus transmit pin functions normally. addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset sci/mi 2/3 baud high (s2bdh) $0050 b2tst b2spl 0 s2b12 s2b11 s2b10 s2b9 s2b8 0000 0000 sci/mi 2/3 baud low (s2bdl) $0051 s2b7 s2b6 s2b5 s2b4 s2b3 s2b2 s2b1 s2b0 0000 0100 mi bus clock rate st 4 xck 16 2 br () ---------------------------- - = addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset sci/mi 2 control 1 (s2cr1) $0052 lops2woms2 mie2 m2 wake2 ilt2 pe2 pt2 0000 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola interconnect bus (mi bus) technical data mc68hc11p2 ? rev 1.0 motorola interconnect bus (mi bus) 6.10.4 s2cr2 ? mi bus2 control register 2 rie2 ? receiver interrupt enable 2 1 = mi bus interrupt requested when rdrf2 flag is set. 0 = rdrf2 and or2 interrupts disabled. te2 ? transmitter enable 2 1 = transmitter enabled and port pin dedicated to the mi bus. 0 = transmitter disabled. re2 ? receiver enable 2 1 = port pin dedicated to the mi bus; the receiver is enabled by a pull sync and is inhibited during a push field. 0 = receiver disabled. sbk2 ? send break 2 1 = mi transmit line is set low for 20 time slots. 0 = no action. when an mi bus wire is held low for eight or more time slots an internal circuit on any slave device connected to the bus may reset or preset the device with default values. 6.10.5 s2sr1 ? mi bus2 status register 1 the bits in s2sr1 indicate certain conditions in the mi bus hardware and are automatically cleared by special acknowledge sequences. the receive related flag bits in s2sr1 (rdrf2, or2 and nf2) are cleared by a read of this register followed by a read of the transmit/receive data register. however, only those bits that were set when s2sr1 was read will be cleared by the subsequent read of the transmit/receive data addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset sci/mi 2 control 2 (s2cr2) $0053 tie2 tcie2 rie2 ilie2 te2 re2 rwu2 sbk2 0000 0000 addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset sci/mi 2 status 1 (s2sr1) $0054 tdre2 tc2 rdrf2 idle2 or2 nf2 fe2 pf2 1100 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola interconnect bus (mi bus) sci/mi bus2 registers mc68hc11p2 ? rev 1.0 technical data motorola interconnect bus (mi bus) rdrf2 ? receive data register full flag 2 1 = contents of the receiver serial shift register have been transferred to the receiver data register. 0 = contents of the receiver serial shift register have not been transferred to the receiver data register. this bit is set when the contents of the receiver serial shift register have been transferred to the receiver data register. the eof (end-of-frame) during an mi bus pull-field is a continuous square wave, which will result in multiple rdrfs. this may be dealt with in any of the following ways: ? by clearing the rie2 mask, ignoring unneeded rdrf2s, initiating a push field, waiting for tdre2 (1) and then clearing the rdrf2; ? by clearing the re2 bit when a pull field is complete, followed by setting the re2 bit after the tdre2 ? flag associated with the next push field is asserted; ? by disabling the mi bus. or2 ? bit error 2 1 = a bit error has been detected. 0 = no bit error has been detected. this bit is set when a push field bit value on the mi bus does not match the bit value that was sent. this is known as an mi bus bit error. or2 does not generate an interrupt request in mi bus mode. nf2 ? noise error flag 2 1 = noise detected. 0 = no noise detected. this bit is set when noise is detected on the receive line during an mi bus pull field. 1. note that tdrex and tcx will both behave in the same way as during normal sci transmis- f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola interconnect bus (mi bus) technical data mc68hc11p2 ? rev 1.0 motorola interconnect bus (mi bus) 6.10.6 s2sr2 ? mi bus2 status register 2 raf ? receiver active flag (read only) 1 = a character is being received. 0 = a character is not being received. 6.10.7 s2drl ? mi bus2 data register this register forms the 8-bit data/address word for the mi push field and contains the 3-bit data word received as the mi pull field. r/t[7:0] ? receiver/transmitter data bits [7:0] read: reads access the three bits of pull field data (stored in bits 3 ? 1) of the read-only mi bus receive data register. bits [7:4, 0] are a fixed data pattern when a valid status and end-of-frame is returned. a valid status is represented by the following data pattern: 0101 xxx1 (bits 7 ? 0), where ? xxx ? is the status. all ones in the receive data register indicate that an error occurred on the mi bus. bits are received lsb first by the mcu, and the status bits map as shown in the above table. write: writes access the eight bits of the write-only mi bus transmit data register. mi bus devices require a 5-bit data pattern followed by a 3-bit address pattern to be sent during the push field. the data pattern is mapped to the lowest five bits of the data register and the address to the highest three bits, as shown in the above table. thus mi-data[4:0] is written to s2drl[4:0] and mi-address[2:0] is written to s2drl[7:5]. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset sci/mi 2 status 2 (s2sr2) $0055 0 0 0 0 0 0 0 raf2 0000 0000 addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset sci/mi 2 data low (s2drl) $0057 r7t7b r6t6b r5t5b r4t4b r3t3b r2t2b r1t1b r0t0b undefined 0 1 0 1 s1s2s3 1pull field a2 a1 a0 d4 d3 d2 d1 d0 push field f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola interconnect bus (mi bus) sci/mi bus3 registers mc68hc11p2 ? rev 1.0 technical data motorola interconnect bus (mi bus) 6.11 sci/mi bus3 registers the mi bus2 and mi bus3 modules share the mi bus delay register (init2) at $0037 and the mi bus2 clock rate register (s2bdh/l) at $0050 ? 51. the two modules are functionally identical to one another and the registers for mi bus3 are given here for reference purposes only. all explanations of bit function can be found in the relevant section of the mi bus2 register descriptions. 6.11.1 s3cr1 ? mi bus3 control register 1 6.11.2 s3cr2 ? mi bus3 control register 2 6.11.3 s3sr1 ? mi bus3 status register 1 6.11.4 s3sr2 ? mi bus3 status register 2 addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset sci/mi 3 control 1 (s3cr1) $005a lops3woms3 mie3 m3 wake3 ilt3 pe3 pt3 0000 0000 addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset sci/mi 3 control 2 (s3cr2) $005b tie3 tcie3 rie3 ilie3 te3 re3 rwu3 sbk3 0000 0000 addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset sci/mi 3 status 1 (s3sr1) $005c tdre3 tc3 rdrf3 idle3 or3 nf3 fe3 pf3 1100 0000 address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset sci/mi 3 status 2 (s3sr2) $005d 0 0 0 0 0 0 0 raf3 0000 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola interconnect bus (mi bus) technical data mc68hc11p2 ? rev 1.0 motorola interconnect bus (mi bus) 6.11.5 s3drl ? mi bus3 data register addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset sci/mi 3 data low (s3drl) $005f r7t7c r6t6c r5t5c r4t4c r3t3c r2t2c r1t1c r0t0c undefined 0101s1s2s31pull field a2 a1 a0 d4 d3 d2 d1 d0 push field f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc11p2 ? rev 1.0 technical data serial peripheral interface (spi) technical data ? mc68hc11p2 section 7. serial peripheral interface (spi) 7.1 contents 7.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 7.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 7.4 spi transfer formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 7.5 spi signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 7.6 spi system errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 7.7 spi registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 7.2 introduction the serial peripheral interface (spi), an independent serial communications subsystem, allows the mcu to communicate synchronously with peripheral devices, such as transistor-transistor logic (ttl) shift registers, liquid crystal (lcd) display drivers, analog-to- digital converter subsystems, and other microprocessors. the spi is also capable of inter-processor communication in a multiple master system. the spi system can be configured as either a master or a slave device, with data rates as high as one half of the e clock rate when configured as a master and as fast as the e clock rate when configured as a slave. the spi shares i/o with four of port d ? s pins and is enabled by spe in the spcr: f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial peripheral interface (spi) technical data mc68hc11p2 ? rev 1.0 serial peripheral interface (spi) 7.3 functional description the central element in the spi system is the block containing the shift register and the read data buffer (see figure 7-1 ). the system is single buffered in the transmit direction and double buffered in the receive direction. this means that new data for transmission cannot be written to the shifter until the previous transfer is complete; however, received data is transferred into a parallel read data buffer so the shifter is free to accept a second serial character. as long as the first character is read out of the read data buffer before the next serial character is ready to be transferred, no overrun condition occurs. a single mcu register address is used for reading data from the read data buffer and for writing data to the shifter. the spi status block represents the spi status functions (transfer complete, write collision, and mode fault) performed by the serial peripheral status register (spsr). the spi control block represents those functions that control the spi system through the serial peripheral control register (spcr). 7.4 spi transfer formats during an spi transfer, data is simultaneously transmitted and received. a serial clock line synchronizes shifting and sampling of the information on the two serial data lines. a slave select line allows individual selection of a slave spi device; slave devices that are not selected do not interfere with spi bus activities. on a master spi device, the select line can pin alternate function pd2 miso pd3 mosi pd4 sck pd5 ss f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial peripheral interface (spi) spi transfer formats mc68hc11p2 ? rev 1.0 technical data serial peripheral interface (spi) optionally be used to indicate a multiple master bus contention. refer to figure 7-2 . figure 7-1. spi block diagram spcr ? spi control register spsr ? spi status register divider spdr ? spi data register shift control logic read data buffer 8-bit shift register opt2 ? options register 2 2 4 8 16 32 64 128 select clock logic spi control miso pd2 mosi pd3 sck pd4 ss pd5 s m s m s m pin control logic mcu system clock spie spe dwom mstr cpol cpha spr1 spr0 spif wcol modf lsbf spr2 mstr spe dwom mstr spe spie lsbf clock spi clock (master) spi interrupt request internal bus f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial peripheral interface (spi) technical data mc68hc11p2 ? rev 1.0 serial peripheral interface (spi) 7.4.1 clock phase and polarity controls software can select one of four combinations of serial clock phase and polarity using two bits in the spi control register (spcr). the clock polarity is specified by the cpol control bit, which selects an active high or active low clock, and has no significant effect on the transfer format. the clock phase (cpha) control bit selects one of two different transfer formats. the clock phase and polarity should be identical for the master spi device and the communicating slave device. in some cases, the phase and polarity are changed between transfers to allow a master device to communicate with peripheral slaves having different requirements. when cpha equals zero, the ss line must be deasserted and reasserted between each successive serial byte. also, if the slave writes data to the spi data register (spdr) while ss is low, a write collision error results. when cpha equals one, the ss line can remain low between figure 7-2. spi transfer format 1 2 3 4 5 6 7 8 msb654321lsb msb654321 lsb sck cycle # (for reference) sck (cpol=0) sck (cpol=1) sample input data out (cpha=0) sample input data out (cpha=1) ss (to slave) note: this figure shows the lsbf=0 (default) case. if lsbf=1, data is transferred in the reverse order (lsb first). f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial peripheral interface (spi) spi signals mc68hc11p2 ? rev 1.0 technical data serial peripheral interface (spi) 7.5 spi signals the following paragraphs contain descriptions of the four spi signals: master in slave out (miso), master out slave in (mosi), serial clock (sck), and slave select (ss ). any spi output line must have its corresponding data direction bit in ddrd register set. if the ddr bit is clear, that line is disconnected from the spi logic and becomes a general-purpose input. all spi input lines are forced to act as inputs regardless of the state of the corresponding ddr bits in ddrd register. 7.5.1 master in slave out miso is one of two unidirectional serial data signals. it is an input to a master device and an output from a slave device. the miso line of a slave device is placed in the high-impedance state if the slave device is not selected. 7.5.2 master out slave in the mosi line is the second of the two unidirectional serial data signals. it is an output from a master device and an input to a slave device. the master device places data on the mosi line a half-cycle before the clock edge that the slave device uses to latch the data. 7.5.3 serial clock sck, an input to a slave device, is generated by the master device and synchronizes data movement in and out of the device through the mosi and miso lines. master and slave devices are capable of exchanging a byte of information during a sequence of eight clock cycles. there are four possible timing relationships that can be chosen by using control bits cpol and cpha in the serial peripheral control register (spcr). both master and slave devices must operate with the same f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial peripheral interface (spi) technical data mc68hc11p2 ? rev 1.0 serial peripheral interface (spi) master device, select the clock rate. in a slave device, spr[1:0] have no effect on the operation of the spi. 7.5.4 slave select the slave select ss input of a slave device must be externally asserted before a master device can exchange data with the slave device. ss must be low before data transactions begin and must stay low for the duration of the transaction. the ss line of the master must be held high. if it goes low, a mode fault error flag (modf) is set in the serial peripheral status register (spsr). to disable the mode fault circuit, write a one in bit 5 of the port d data direction register. this sets the ss pin to act as a general-purpose output, rather than a dedicated input to the slave select circuit, thus inhibiting the mode fault flag. the other three lines are dedicated to the spi whenever the serial peripheral interface is on. the state of the master and slave cpha bits affects the operation of ss . cpha settings should be identical for master and slave. when cpha = 0, the shift clock is the or of ss with sck. in this clock phase mode, ss must go high between successive characters in an spi message. when cpha = 1, ss can be left low between successive spi characters. in cases where there is only one spi slave mcu, its ss line can be tied to v ss as long as only cpha = 1 clock mode is used. 7.6 spi system errors two kinds of system errors can be detected by the spi system. the first type of error arises in a multiple-master system when more than one spi device simultaneously tries to be a master. this error is called a mode fault. the second type of error, write collision, indicates that an attempt was made to write data to the spdr while a transfer was in progress. when the spi system is configured as a master and the ss input line goes to active low, a mode fault error has occurred ? usually because f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial peripheral interface (spi) spi system errors mc68hc11p2 ? rev 1.0 technical data serial peripheral interface (spi) master, there is a chance of contention between two pin drivers. for push-pull cmos drivers, this contention can cause permanent damage. the mode fault detection circuitry attempts to protect the device by disabling the drivers. the mstr control bit in the spcr and all four ddrd control bits associated with the spi are cleared and an interrupt is generated (subject to masking by the spie control bit and the i bit in the ccr). other precautions may need to be taken to prevent driver damage. if two devices are made masters at the same time, the mode fault detector does not help protect either one unless one of them selects the other as slave. the amount of damage possible depends on the length of time both devices attempt to act as master. a write collision error occurs if the spdr is written while a transfer is in progress. because the spdr is not double buffered in the transmit direction, writes to spdr cause data to be written directly into the spi shift register. because this write corrupts any transfer in progress, a write collision error is generated. the transfer continues undisturbed, and the write data that caused the error is not written to the shifter. a write collision is normally a slave error because a slave has no control over when a master initiates a transfer. a master knows when a transfer is in progress, so there is no reason for a master to generate a write- collision error, although the spi logic can detect write collisions in both master and slave devices. the spi configuration determines the characteristics of a transfer in progress. for a master, a transfer begins when data is written to spdr and ends when spif is set. for a slave with cpha equal to zero, a transfer starts when ss goes low and ends when ss returns high. in this case, spif is set at the middle of the eighth sck cycle when data is transferred from the shifter to the parallel data register, but the transfer is still in progress until ss goes high. for a slave with cpha equal to one, transfer begins when the sck line goes to its active level, which is the edge at the beginning of the first sck cycle. the transfer ends when spif is set, for a slave in which cpha=1. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial peripheral interface (spi) technical data mc68hc11p2 ? rev 1.0 serial peripheral interface (spi) 7.7 spi registers the three spi registers, spcr, spsr, and spdr, provide control, status, and data storage functions. refer to the following information for a description of how these registers are organized. 7.7.1 spcr ? serial peripheral control register spie ? serial peripheral interrupt enable 1 = a hardware interrupt sequence is requested each time spif or modf is set. 0 = spi interrupts are inhibited. set the spie bit to a one to request a hardware interrupt sequence each time the spif or modf status flag is set. spi interrupts are inhibited if this bit is clear or if the i bit in the condition code register is one. spe ? serial peripheral system enable 1 = port d [5:2] is dedicated to the spi. 0 = port d has its default i/o functions. when the spe bit is set, the port d pins 2, 3, 4, and 5 are dedicated to the spi functions and lose their general purpose i/o functions. when the spi system is enabled and expects any of pd[4:2] to be inputs then those pins will be inputs regardless of the state of the associated ddrd bits. if any of pd[4:2] are expected to be outputs then those pins will be outputs only if the associated ddrd bits are set. however, if the spi is in the master mode, ddd5 determines whether pd5 is an error detect input (ddd5 = 0) or a general-purpose output (ddd5 = 1). dwom ? port d wired-or mode 1 = port d [5:2] buffers configured for open-drain outputs. 0 = port d [5:2] buffers configured for normal cmos outputs. addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset spi control (spcr) $0028 spie spe dwom mstr cpol cpha spr1 spr0 0000 01uu f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial peripheral interface (spi) spi registers mc68hc11p2 ? rev 1.0 technical data serial peripheral interface (spi) mstr ? master mode select 1 = master mode 0 = slave mode cpol ? clock polarity 1 = sck is active low. 0 = sck is active high. when the clock polarity bit is cleared and data is not being transferred, the sck pin of the master device has a steady state low value. when cpol is set, sck idles high. refer to figure 7-2 and clock phase and polarity controls . cpha ? clock phase the clock phase bit, in conjunction with the cpol bit, controls the clock-data relationship between master and slave. the cpha bit selects one of two different clocking protocols. refer to figure 7-2 and clock phase and polarity controls . spr1 and spr0 ? spi clock rate selects these two bits select the spi clock rate, as shown in table 7-1 . note that spr2 is located in the opt2 register and its state on reset is zero. table 7-1. spi clock rates spr[2:0] e clock divide ratio spi clock frequency ( baud rate) for: e = 2 mhz e = 3 mhz e = 4 mhz 0 0 0 2 1.0 mhz 1.5 mhz 2.0 mhz 0 0 1 4 500 khz 750khz 1.0 mhz 0 1 0 16 125 khz 187.5 khz 250 khz 0 1 1 32 62.5 khz 93.7 khz 125 khz 1 0 0 8 250 khz 375 khz 500 khz 1 0 1 16 125 khz 187.5 khz 250 khz 1 1 0 64 31.3 khz 46.9 khz 62.5 khz 1 1 1 128 15.6 khz 23.4 khz 31.3 khz f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial peripheral interface (spi) technical data mc68hc11p2 ? rev 1.0 serial peripheral interface (spi) 7.7.2 spsr ? serial peripheral status register spif ? spi interrupt complete flag 1 = data transfer to external device has been completed. 0 = no valid completion of data transfer. spif is set upon completion of data transfer between the processor and the external device. if spif goes high, and if spie is set, a serial peripheral interrupt is generated. to clear the spif bit, read the spsr with spif set, then access the spdr. unless spsr is read (with spif set) first, attempts to write spdr are inhibited. wcol ? write collision 1 = write collision. 0 = no write collision. clearing the wcol bit is accomplished by reading the spsr (with wcol set) followed by an access of spdr. refer to slave select and spi system errors . modf ? mode fault 1 = mode fault. 0 = no mode fault. to clear the modf bit, read the spsr (with modf set), then write to the spcr. refer to slave select and spi system errors . bits [5, 3:0] ? not implemented; always read zero. addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset spi status (spsr) $0029 spif wcol 0 modf 0 0 0 0 0000 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial peripheral interface (spi) spi registers mc68hc11p2 ? rev 1.0 technical data serial peripheral interface (spi) 7.7.3 spdr ? spi data register the spdr is used when transmitting or receiving data on the serial bus. only a write to this register initiates transmission or reception of a byte, and this only occurs in the master device. at the completion of transferring a byte of data, the spif status bit is set in both the master and slave devices. a read of the spdr is actually a read of a buffer. to prevent an overrun and the loss of the byte that caused the overrun, the first spif must be cleared by the time a second transfer of data from the shift register to the read buffer is initiated. spi is double buffered in and single buffered out. 7.7.4 opt2 ? system configuration options register 2 lirdv ? lir driven (refer to operating modes and on-chip memory ) 1 = enable lir drive high pulse. 0 = lir only driven low ? requires pull-up on pin. cwom ? port c wired-or mode (refer to parallel input/output ) 1 = port c outputs are open-drain. 0 = port c operates normally. strch ? stretch external accesses (refer to operating modes and on-chip memory ) 1 = off-chip accesses are extended by one e clock cycle. 0 = normal operation. addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset spi data (spdr) $002a (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) not affected addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset system config. options 2 (opt2) $0038 lirdv cwom strc h irvne lsbf spr2 0 0 000x 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial peripheral interface (spi) technical data mc68hc11p2 ? rev 1.0 serial peripheral interface (spi) irvne ? internal read visibility/not e (refer to operating modes and on-chip memory ) 1 = data from internal reads is driven out of the external data bus. 0 = no visibility of internal reads on external bus. in single chip mode this bit determines whether the e clock drives out from the chip. 1 = e pin is driven low. 0 = e clock is driven out from the chip. lsbf ? lsb first enable 1 = data is transferred lsb first. 0 = data is transferred msb first. if this bit is set, data, which is usually transferred msb first, is transferred lsb first. lsbf does not affect the position of the msb and lsb in the data register. reads and writes of the data register always have msb in bit 7. spr2 ? spi clock rate select when set, spr2 adds a divide-by-4 prescaler to the spi clock chain. with the two bits in the spcr, this bit specifies the spi clock rate. refer to table 7-1 . bits 1, 0 ? not implemented; always read zero. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc11p2 ? rev 1.0 technical data timing system technical data ? mc68hc11p2 section 8. timing system 8.1 contents 8.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 8.3 timer structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 8.4 input capture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 8.5 output compare . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 8.6 real-time interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 8.7 computer operating properly watchdog function . . . . . . . 157 8.8 pulse accumulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 8.9 pulse-width modulation (pwm) timer . . . . . . . . . . . . . . . . . 162 8.2 introduction the m68hc11 timing system is composed of five clock divider chains. the main clock divider chain includes a 16-bit free-running counter, which is driven by a programmable prescaler. the main timer ? s programmable prescaler provides one of the four clocking rates to drive the 16-bit counter. two prescaler control bits select the prescale rate. the prescaler output divides the system clock by 1, 4, 8, or 16. taps from this main clocking chain drive circuitry generate the slower clocks used by the pulse accumulator, the real-time interrupt (rti), and the computer operating properly (cop) watchdog subsystems, which are also described in this section. refer to figure 8-1 . all main timer system activities are referenced to this free-running f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system technical data mc68hc11p2 ? rev 1.0 timing system maximum count, the counter rolls over to $0000, sets an overflow flag and continues to increment. as long as the mcu is running in a normal operating mode, there is no way to reset, change or interrupt the counting. the capture/compare subsystem features three input capture channels, four output compare channels and one channel that can be selected to perform either input capture or output compare. each of the three input capture functions has its own 16-bit input capture register (time capture latch) and each of the output compare functions has its own 16-bit compare register. all timer functions, including the timer overflow and rti, have their own interrupt controls and separate interrupt vectors. the pulse accumulator contains an 8-bit counter and edge select logic. the pulse accumulator can operate in either event counting mode or gated time accumulation mode. during event counting mode, the pulse accumulator ? s 8-bit counter increments when a specified edge is detected on an input signal. during gated time accumulation mode, an internal clock source increments the 8-bit counter while an input signal has a predetermined logic level. the real-time interrupt (rti) is a programmable periodic interrupt circuit that permits pacing the execution of software routines by selecting one of four interrupt rates. the cop watchdog clock input (e/2 15 ) is tapped off from the free- running counter chain. the cop automatically times out unless it is serviced within a specific time by a program reset sequence. if the cop is allowed to time out, a reset is generated, which drives the reset pin low to reset the mcu and the external system. refer to table 8-1 for crystal related frequencies and periods. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system timer structure mc68hc11p2 ? rev 1.0 technical data timing system 8.3 timer structure the timer functions share i/o with all eight pins of port a: figure 8-2 shows the capture/compare system block diagram. the port a pin control block includes logic for timer functions and for general- purpose i/o. for pins pa3, pa2, pa1 and pa0, this block contains both the edge-detection logic and the control logic that enables the selection of which edge triggers an input capture. the digital level on pa[3:0] can be read at any time (read porta register), even if the pin is being used table 8-1. timer resolution and capacity clock 4.0mhz 8.0mhz 12.0mhz 16.0mhz 4e xtal control bits pr[1:0] 1.0mhz 2.0mhz 3.0mhz 4.0mhz e e clock 1000ns 500ns 333ns 250ns 1/e period 0 0 1.0s 65.536ms 500ns 32.768ms 333ns 21.845ms 250ns 16.384ms 1/e 2 16 /e ? resolution ? overflow 0 1 4.0s 262.14ms 2.0s 131.07ms 1.333s 87.381ms 1.0s 65.536ms 4/e 2 18 /e ? resolution ? overflow 1 0 8.0s 524.29ms 4.0s 262.14ms 2.667s 174.76ms 2.0s 131.07ms 8/e 2 19 /e ? resolution ? overflow 1 1 16.0s 1049ms 8.0s 524.29ms 5.333s 349.53ms 4.0s 262.14ms 16/e 2 20 /e ? resolution ? overflow pin alternate function pa0 ic3 pa1 ic2 pa2 ic1 pa3 oc5 and/or oc1, or ic4 pa4 oc4 and/or oc1 pa5 oc3 and/or oc1 pa6 oc2 and/or oc1 pa7 pai and/or oc1 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system technical data mc68hc11p2 ? rev 1.0 timing system used for an output compare function, it cannot be written directly as if it were a general-purpose output. each of the output compare functions (oc[5:2]) is related to one of the port a output pins. output compare 1 (oc1) has extra control logic, allowing it optional control of any combination of the pa[7:3] pins. the pa7 pin can be used as a general- purpose i/o pin, as an input to the pulse accumulator or as an oc1 output pin. set q q reset ff1 + oscillator and clock generator 2 2 4 baud 1, 2, 3, 4, 5, ? , 8191 sci receiver clock 16 sci transmitter clock e clock prescaler 2, 4, 8,16, 32, 64, 128 spr[2:0] internal bus clock (ph2) spi e/2 6 e/2 13 pulse accumulator prescaler 1, 2, 4, 8 rtr[1:0] real time interrupt 4 prescaler 1, 4, 8, 16 pr[1:0] tcnt tof prescaler 1, 4, 16, 64 cr[1:0] set q q reset ff2 system reset clear cop timer force cop reset e/2 15 ic/oc f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system timer structure mc68hc11p2 ? rev 1.0 technical data timing system + & prescaler 1, 4, 8, 16 pr[1:0] mcu e clock 16-bit free running counter tcnt (hi) tcnt (lo) toc1 (lo) & 9 toc1 (hi) 16-bit comparator eq toc2 (lo) toc2 (hi) 16-bit comparator eq toc3 (lo) toc3 (hi) 16-bit comparator eq toc4 (lo) toc4 (hi) 16-bit comparator eq ti4/o5 (lo) ti4/o5 (hi) 16-bit comparator eq tic1 (lo) tic1 (hi) tic2 (lo) tic2 (hi) tic3 (lo) tic3 (hi) 16-bit timer bus 16-bit latch clk 16-bit latch clk 16-bit latch clk 16-bit latch clk oc1f tof toi i4/o5f 8 oc2f oc3f oc4f ic1f ic2f ic3f i4/o5 oc5 ic4 oc1i foc1 bit 7 + & 7 oc2i foc2 + & 6 oc3i foc3 + & 5 oc4i foc4 + & 4 i4/o5i foc5 & ic1i 3 & ic3i 1 & ic2i 2 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 pa6/ oc2/ oc1 pa5/ oc3/ oc1 pa4/ oc4/ oc1 pa3/ oc5/ oc1/ pa2/ ic1 ic4 pa1/ ic2 pa0/ ic3 tflg1 status flags tmsk1 interrupt enables port a pin control ? ? port a pin actions are controlled by oc1m, oc1d, pactl, tctl1 and tctl2 registers pins/ functions cforc force o/p compare to pulse accumulator taps for rti, cop and pa note ? ? interrupt requests 1 ? 9 (these are further qualified by the i-bit in the ccr) pa7/ oc1/ pai f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system technical data mc68hc11p2 ? rev 1.0 timing system 8.4 input capture the input capture function records the time an external event occurs by latching the value of the free-running counter when a selected edge is detected at the associated timer input pin. software can store latched values and use them to compute the periodicity and duration of events. for example, by storing the times of successive edges of an incoming signal, software can determine the period and pulse width of a signal. to measure period, two successive edges of the same polarity are captured. to measure pulse width, two alternate polarity edges are captured. in most cases, input capture edges are asynchronous with respect to the internal timer counter, which is clocked relative to an internal clock (ph2). these asynchronous capture requests are synchronized with ph2 so that latching occurs on the opposite half cycle of ph2 from when the timer counter is being incremented. this synchronization process introduces a delay from when the edge occurs to when the counter value is detected. because these delays cancel out when the time between two edges is being measured, the delay can be ignored. when an input capture is being used with an output compare, there is a similar delay between the actual compare point and when the output pin changes state. the control and status bits that implement the input capture functions are contained in the pactl, tctl2, tmsk1, and tflg1 registers. to configure port a bit 3 as an input capture, clear the dda3 bit of the ddra register. note that this bit is cleared out of reset. to enable pa3 as the fourth input capture, set the i4/o5 bit in the pactl register. otherwise, pa3 is configured as a fifth output compare out of reset, with bit i4/o5 being cleared. if the dda3 bit is set (configuring pa3 as an output), and ic4 is enabled, then writes to pa3 cause edges on the pin to result in input captures. writing to ti4/o5 has no effect when the ti4/o5 register is acting as ic4. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system input capture mc68hc11p2 ? rev 1.0 technical data timing system 8.4.1 tctl2 ? timer control register 2 use the control bits of this register to program input capture functions to detect a particular edge polarity on the corresponding timer input pin. each of the input capture functions can be independently configured to detect rising edges only, falling edges only, any edge (rising or falling), or to disable the input capture function. the input capture functions operate independently of each other and can capture the same tcnt value if the input edges are detected within the same timer count cycle. edgxb and edgxa ? input capture edge control there are four pairs of these bits. each pair is cleared by reset and must be encoded to configure the corresponding input capture edge detector circuit. ic4 functions only if the i4/o5 bit in the pactl register is set. addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset timer control 2 (tctl2) $0021 edg4bedg4aedg1bedg1aedg2bedg2aedg3bedg3a 0000 0000 edgxb edgxa configuration 0 0 icx disabled 0 1 icx captures on rising edges only 1 0 icx captures on falling edges only 1 1 icx captures on any edge f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system technical data mc68hc11p2 ? rev 1.0 timing system 8.4.2 tic1 ? tic3 ? timer input capture registers when an edge has been detected and synchronized, the 16-bit free- running counter value is transferred into the input capture register pair as a single 16-bit parallel transfer. timer counter value captures and timer counter incrementing occur on opposite half-cycles of the phase 2 clock so that the count value is stable whenever a capture occurs. input capture values can be read from a pair of 8-bit read-only registers. a read of the high-order byte of an input capture register pair inhibits a new capture transfer for one bus cycle. if a double-byte read instruction, such as ldd, is used to read the captured value, coherency is assured. when a new input capture occurs immediately after a high-order byte read, transfer is delayed for an additional cycle but the value is not lost. the ticx registers are not affected by reset. addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset timer input capture 1 (tic1) high $0010 (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) not affected timer input capture 1 (tic1) low $0011 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) not affected timer input capture 2 (tic2) high $0012 (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) not affected timer input capture 2 (tic2) low $0013 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) not affected timer input capture 3 (tic3) high $0014 (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) not affected timer input capture 3 (tic3) low $0015 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) not affected f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system output compare mc68hc11p2 ? rev 1.0 technical data timing system 8.4.3 ti4/o5 ? timer input capture 4/output compare 5 register use ti4/o5 as either an input capture register or an output compare register, depending on the function chosen for the pa3 pin. to enable it as an input capture pin, set the i4/o5 bit in the pulse accumulator control register (pactl) to logic level one. to use it as an output compare register, set the i4/o5 bit to a logic level zero. refer to pactl ? pulse accumulator control register . the ti4/o5 register pair resets to ones ($ffff). 8.5 output compare use the output compare (oc) function to program an action to occur at a specific time ? when the 16-bit counter reaches a specified value. for each of the five output compare functions, there is a separate 16-bit compare register and a dedicated 16-bit comparator. the value in the compare register is compared to the value of the free-running counter on every bus cycle. when the compare register matches the counter value, an output compare status flag is set. the flag can be used to initiate the automatic actions for that output compare function. to produce a pulse of a specific duration, write a value to the output compare register that represents the time the leading edge of the pulse is to occur. the output compare circuit is configured to set the appropriate output either high or low, depending on the polarity of the pulse being produced. after a match occurs, the output compare register is reprogrammed to change the output pin back to its inactive level at the next match. a value representing the width of the pulse is added to the original value, and then written to the output compare register. because the pin state changes occur at specific values of the free-running addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset capture 4/compare 5 (ti4/o5) high $001e (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) 1111 1111 capture 4/compare 5 (ti4/o5) low $001f (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system technical data mc68hc11p2 ? rev 1.0 timing system the free-running counter, independent of software latency. to generate an output signal of a specific frequency and duty cycle, repeat this pulse- generating procedure. there are four 16-bit read/write output compare registers: toc1, toc2, toc3, and toc4, and the ti4/o5 register, which functions under software control as either ic4 or oc5. each of the oc registers is set to $ffff on reset. a value written to an oc register is compared to the free-running counter value during each e clock cycle. if a match is found, the particular output compare flag is set in timer interrupt flag register 1 (tflg1). if that particular interrupt is enabled in the timer interrupt mask register 1 (tmsk1), an interrupt is generated. in addition to an interrupt, a specified action can be initiated at one or more timer output pins. for oc[5:2], the pin action is controlled by pairs of bits (omx and olx) in the tctl1 register. the output action is taken on each successful compare, regardless of whether or not the ocxf flag in the tflg1 register was previously cleared. oc1 is different from the other output compares in that a successful oc1 compare can affect any or all five of the oc pins. the oc1 output action taken when a match is found is controlled by two 8-bit registers with three bits unimplemented: the output compare 1 mask register, oc1m, and the output compare 1 data register, oc1d. oc1m specifies which port a outputs are to be used, and oc1d specifies what data is placed on these port pins. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system output compare mc68hc11p2 ? rev 1.0 technical data timing system 8.5.1 toc1 ? toc4 ? timer output compare registers all output compare registers are 16-bit read-write. each is initialized to $ffff at reset. if an output compare register is not used for an output compare function, it can be used as a storage location. a write to the high-order byte of an output compare register pair inhibits the output compare function for one bus cycle. this inhibition prevents inappropriate subsequent comparisons. coherency requires a complete 16-bit read or write. however, if coherency is not needed, byte accesses can be used. for output compare functions, write a comparison value to output compare registers toc1 ? toc4 and ti4/o5. when tcnt value matches the comparison value, specified pin actions occur. all tocx register pairs reset to ones ($ffff). address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset timer output compare 1 (toc1) high $0016 (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) 1111 1111 timer output compare 1 (toc1) low $0017 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 timer output compare 2 (toc2) high $0018 (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) 1111 1111 timer output compare 2 (toc2) low $0019 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 timer output compare 3 (toc3) high $001a (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) 1111 1111 timer output compare 3 (toc3) low $001b (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 timer output compare 4 (toc4) high $001c (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) 1111 1111 timer output compare 4 (toc4) low $001d (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system technical data mc68hc11p2 ? rev 1.0 timing system 8.5.2 cforc ? timer compare force register the cforc register allows forced early compares. foc[1:5] correspond to the five output compares. these bits are set for each output compare that is to be forced. the action taken as a result of a forced compare is the same as if there were a match between the ocx register and the free-running counter, except that the corresponding interrupt status flag bits are not set. the forced channels trigger their programmed pin actions to occur at the next timer count transition after the write to cforc. the cforc bits should not be used on an output compare function that is programmed to toggle its output on a successful compare because a normal compare that occurs immediately before or after the force can result in an undesirable operation. foc[1:5] ? force output compares 1 = a forced output compare action will occur on the specified pin. 0 = no action. bits [2:0] ? not implemented; always read zero 8.5.3 oc1m ? output compare 1 mask register use oc1m with oc1 to specify the bits of port a that are affected by a successful oc1 compare. the bits of the oc1m register correspond to pa7 ? pa3. oc1m[7:3] ? output compare masks for oc1 1 = oc1 is configured to control the corresponding pin of port a. addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset timer compare force (cforc) $000b foc1 foc2 foc3 foc4 foc5 0 0 0 0000 0000 addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset output compare 1 mask (oc1m) $000c oc1m 7 oc1m 6 oc1m 5 oc1m 4 oc1m 3 0 0 0 0000 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system output compare mc68hc11p2 ? rev 1.0 technical data timing system 8.5.4 oc1d ? output compare 1 data register use this register with oc1 to specify the data that is to be written to the affected pin of port a after a successful oc1 compare. when a successful oc1 compare occurs, a data bit in oc1d is written to the corresponding pin of port a for each bit that is set in oc1m. oc1d[7:3] ? output compare data for oc1 if oc1mx is set, data in oc1dx is output to port a pin x on successful oc1 compares. bits [2:0] ? not implemented; always read zero 8.5.5 tcnt ? timer counter register the 16-bit read-only tcnt register contains the prescaled value of the 16-bit timer. a full counter read addresses the more significant byte (msb) first. a read of this address causes the less significant byte (lsb) to be latched into a buffer for the next cpu cycle so that a double-byte read returns the full 16-bit state of the counter at the time of the msb read cycle. tcnt resets to $0000. addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset output compare 1 data (oc1d) $000d oc1d7oc1d6oc1d5oc1d4oc1d3 0 0 0 0000 0000 addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset timer count (tcnt) high $000e (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) 0000 0000 timer count (tcnt) low $000f (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 0000 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system technical data mc68hc11p2 ? rev 1.0 timing system 8.5.6 tctl1 ? timer control register 1 the bits of this register specify the action taken as a result of a successful ocx compare. om[2:5] ? output mode ol[2:5] ? output level these control bit pairs are encoded to specify the action taken after a successful ocx compare. oc5 functions only if the i4/o5 bit in the pactl register is clear. 8.5.7 tmsk1 ? timer interrupt mask register 1 use this 8-bit register to enable or inhibit the timer input capture and output compare interrupts. note: bits in tmsk1 correspond bit for bit with flag bits in tflg1. ones in tmsk1 enable the corresponding interrupt sources. oc1i ? oc4i ? output compare x interrupt enable 1 = ocx interrupt is enabled. 0 = ocx interrupt is disabled. if the ocxi enable bit is set when the ocxf flag bit is set, a hardware interrupt sequence is requested. addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset timer control 1 (tctl1) $0020 om2 ol2 om3 ol3 om4 ol4 om5 ol5 0000 0000 omx olx action taken on successful compare 0 0 timer disconnected from ocx pin logic 0 1 toggle ocx output line 1 0 clear ocx output line to 0 1 1 set ocx output line to 1 addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset timer interrupt mask 1 (tmsk1) $0022 oc1i oc2i oc3i oc4i i4/o5i ic1i ic2i ic3i 0000 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system output compare mc68hc11p2 ? rev 1.0 technical data timing system i4/o5i ? input capture 4/output compare 5 interrupt enable 1 = ic4/oc5 interrupt is enabled. 0 = ic4/oc5 interrupt is disabled. when i4/o5 in pactl is set, i4/o5i is the input capture 4 interrupt enable bit. when i4/o5 in pactl is zero, i4/o5i is the output compare 5 interrupt enable bit. ic1i ? ic3i ? input capture x interrupt enable 1 = icx interrupt is enabled. 0 = icx interrupt is disabled. if the icxi enable bit is set when the icxf flag bit is set, a hardware interrupt sequence is requested. 8.5.8 tflg1 ? timer interrupt flag register 1 bits in this register indicate when timer system events have occurred. coupled with the bits of tmsk1, the bits of tflg1 allow the timer subsystem to operate in either a polled or interrupt driven system. clear flags by writing a one to the corresponding bit position(s). note: bits in tflg1 correspond bit for bit with flag bits in tmsk1. ones in tmsk1 enable the corresponding interrupt sources. oc1f ? oc4f ? output compare x flag 1 = counter has reached the preset output compare x value. 0 = counter has not reached the preset output compare x value. these flags are set each time the counter matches the corresponding output compare x values. i4/o5f ? input capture 4/output compare 5 flag set by ic4 or oc5, depending on the function enabled by i4/o5 bit in pactl address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset timer interrupt flag 1 (tflg1) $0023 oc1f oc2f oc3f oc4f i4/o5f ic1f ic2f ic3f 0000 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system technical data mc68hc11p2 ? rev 1.0 timing system ic1f ? ic3f ? input capture x flag 1 = selected edge has been detected on corresponding port pin. 0 = selected edge has not been detected on corresponding port pin. these flags are set each time a selected active edge is detected on the icx input line 8.5.9 tmsk2 ? timer interrupt mask register 2 use this 8-bit register to enable or inhibit timer overflow and real-time interrupts. the timer prescaler control bits are included in this register. note: bits in tmsk2 correspond bit for bit with flag bits in tflg2. ones in tmsk2 enable the corresponding interrupt sources. toi ? timer overflow interrupt enable 1 = timer overflow interrupt requested when tof is set. 0 = tof interrupts disabled. rtii ? real-time interrupt enable (refer to real-time interrupt ) paovi ? pulse accumulator overflow interrupt enable (refer to pulse accumulator status and interrupt bits ) paii ? pulse accumulator input edge interrupt enable (refer to pulse accumulator status and interrupt bits ) pr[1:0] ? timer prescaler select address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset timer interrupt mask 2 (tmsk2) $0024 toi rtii paovi paii 0 0 pr1 pr0 0000 0000 pr[1:0] prescaler 0 0 1 0 1 4 1 0 8 1 1 16 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system output compare mc68hc11p2 ? rev 1.0 technical data timing system these bits are used to select the prescaler divide-by ratio. in normal modes, pr[1:0] can only be written once, and the write must be within 64 cycles after reset. see table 8-1 for specific timing values. 8.5.10 tflg2 ? timer interrupt flag register 2 bits in this register indicate when certain timer system events have occurred. coupled with the four high-order bits of tmsk2, the bits of tflg2 allow the timer subsystem to operate in either a polled or interrupt driven system. clear flags by writing a one to the corresponding bit position(s). note: bits in tflg2 correspond bit for bit with flag bits in tmsk2. ones in tmsk2 enable the corresponding interrupt sources. tof ? timer overflow interrupt flag 1 = tcnt has overflowed from $ffff to $0000. 0 = no timer overflow has occurred. rtif ? real time (periodic) interrupt flag (refer to real-time interrupt ) paovf ? pulse accumulator overflow interrupt flag (refer to pulse accumulator ) paif ? pulse accumulator input edge interrupt flag (refer to pulse accumulator .) bits [3:0] ? not implemented; always read zero addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset timer interrupt flag 2 (tflg2) $0025 tof rtif paovf paif 0 0 0 0 0000 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system technical data mc68hc11p2 ? rev 1.0 timing system 8.6 real-time interrupt the real-time interrupt (rti) feature, used to generate hardware interrupts at a fixed periodic rate, is controlled and configured by two bits (rtr1 and rtr0) in the pulse accumulator control (pactl) register. the rtii bit in the tmsk2 register enables the interrupt capability. the four different rates available are a product of the mcu oscillator frequency and the value of bits rtr[1:0]. refer to table 8-2 , which shows the periodic real-time interrupt rates. the clock source for the rti function is a free-running clock that cannot be stopped or interrupted except by reset. this clock causes the time between successive rti timeouts to be a constant that is independent of the software latency associated with flag clearing and service. for this reason, an rti period starts from the previous timeout, not from when rtif is cleared. every timeout causes the rtif bit in tflg2 to be set, and if rtii is set, an interrupt request is generated. after reset, one entire rti period elapses before the rtif flag is set for the first time. refer to the tmsk2, tflg2, and pactl registers. table 8-2. rti periodic rates rtr[1:0] e = 3 mhz e = 2 mhz e = 1 mhz e = x mhz 0 0 0 1 1 0 1 1 2.731ms 5.461ms 10.923ms 21.845ms 4.096ms 8.192ms 16.384ms 32.768ms 8.192ms 16.384ms 32.768ms 65.536ms 2 13 /e 2 14 /e 2 15 /e 2 16 /e f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system real-time interrupt mc68hc11p2 ? rev 1.0 technical data timing system 8.6.1 tmsk2 ? timer interrupt mask register 2 this register contains the real-time interrupt enable bit. note: bits in tmsk2 correspond bit for bit with flag bits in tflg2. ones in tmsk2 enable the corresponding interrupt sources. toi ? timer overflow interrupt enable (refer to tmsk2 ? timer interrupt mask register 2 ) rtii ? real-time interrupt enable 1 = real time interrupt requested when rtif is set. 0 = real time interrupts disabled. paovi ? pulse accumulator overflow interrupt enable (refer to pulse accumulator ) paii ? pulse accumulator input edge (refer to pulse accumulator ) pr[1:0] ? timer prescaler select (refer to tmsk2 ? timer interrupt mask register 2 ) addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset timer interrupt mask 2 (tmsk2) $0024 toi rtii paovi paii 0 0 pr1 pr0 0000 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system technical data mc68hc11p2 ? rev 1.0 timing system 8.6.2 tflg2 ? timer interrupt flag register 2 bits of this register indicate the occurrence of timer system events. coupled with the four high-order bits of tmsk2, the bits of tflg2 allow the timer subsystem to operate in either a polled or interrupt driven system. clear flags by writing a one to the corresponding bit position(s). note: bits in tflg2 correspond bit for bit with flag bits in tmsk2. ones in tmsk2 enable the corresponding interrupt sources. tof ? timer overflow interrupt flag 1 = the timer has overflowed, from $ffff to $0000. 0 = no timer overflow has occurred. rtif ? real-time interrupt flag 1 = rti period has elapsed. 0 = rti flag has been cleared. the rtif status bit is automatically set to one at the end of every rti period. paovf ? pulse accumulator overflow interrupt flag (refer to pulse accumulator ) paif ? pulse accumulator input edge interrupt flag (refer to pulse accumulator ) bits [3:0] ? not implemented; always read zero addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset timer interrupt flag 2 (tflg2) $0025 tof rtif paovf paif 0 0 0 0 0000 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system computer operating properly watchdog function mc68hc11p2 ? rev 1.0 technical data timing system 8.6.3 pactl ? pulse accumulator control register bits rtr[1:0] of this register select the rate for the rti system. the remaining bits control the pulse accumulator and ic4/oc5 functions. bits 7, 3 ? not implemented; always read zero paen ? pulse accumulator system enable (refer to pulse accumulator ) pamod ? pulse accumulator mode (refer to pulse accumulator ) pedge ? pulse accumulator edge control (refer to pulse accumulator ) i4/o5 ? input capture 4/output compare (refer to pulse accumulator ) rtr[1:0] ? rti interrupt rate select these two bits determine the rate at which the rti system requests interrupts. the rti system is driven by an e/2 13 clock rate that is compensated so it is independent of the timer prescaler. these two control bits select an additional division factor. refer to table 8-2 . 8.7 computer operating properly watchdog function the clocking chain for the cop function, tapped off from the main timer divider chain, is only superficially related to the main timer system. the cr[1:0] bits in the option register and the nocop bit in the config register determine the status of the cop function. one additional register, coprst, is used to arm and clear the cop watchdog reset system. refer to resets and interrupts for a more detailed discussion of the cop function. addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset pulse accumulator control (pactl) $0026 0 paen pamodpedge 0 i4/o5 rtr1 rtr0 0000 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system technical data mc68hc11p2 ? rev 1.0 timing system 8.8 pulse accumulator the mc68hc11p2 has an 8-bit counter that can be configured to operate either as a simple event counter, or for gated time accumulation, depending on the state of the pamod bit in the pactl register. refer to the pulse accumulator block diagram, figure 8-3 . in the event counting mode, the 8-bit counter is clocked to increasing values by an external pin. the maximum clocking rate for the external event counting mode is the e clock divided by two. in gated time accumulation mode, a free-running e clock 64 signal drives the 8-bit counter, but only while the external pai pin is activated. refer to table 8-3 . the pulse accumulator counter can be read or written at any time. table 8-3. pulse accumulator timing crystal frequency e clock cycle time 64/e pacnt overflow 4.0 mhz 1.0 mhz 1000 ns 64 s 16.384 ms 8.0 mhz 2.0 mhz 500 ns 32 s 8.192 ms 12.0 mhz 3.0 mhz 333 ns 21.33 s 5.461 ms 16.0 mhz 4.0 mhz 250 ns 16.0 s 4.096 ms f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system pulse accumulator mc68hc11p2 ? rev 1.0 technical data timing system pulse accumulator control bits are also located within two timer registers, tmsk2 and tflg2, as described in the following paragraphs. figure 8-3. pulse accumulator block diagram tof 0 paovf paif 0 0 0 tflg2 rtif toi rtii 0 paii 0 pr1 pr0 tmsk2 0 paen 0 pamod pactl paovi rtr1 rtr0 pedge i4/o5 & & pacnt 1 2 pa7/ oc1/ pai 2:1 mux input buffer and edge detector output buffer & from ddra7 from oc1 e/64 clock (from main timer) overflow enable clock interrupt requests internal data bus disable flag setting f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system technical data mc68hc11p2 ? rev 1.0 timing system 8.8.1 pactl ? pulse accumulator control register four of this register ? s bits control an 8-bit pulse accumulator system. another bit enables either the oc5 function or the ic4 function, while two other bits select the rate for the real-time interrupt system. bits [7, 3] ? not implemented; always read zero paen ? pulse accumulator system enable 1 = pulse accumulator enabled. 0 = pulse accumulator disabled. pamod ? pulse accumulator mode 1 = gated time accumulation mode. 0 = event counter mode. pedge ? pulse accumulator edge control this bit has different meanings depending on the state of the pamod bit, as shown: i4/o5 ? input capture 4/output compare 5 1 = input capture 4 function is enabled (no oc5). 0 = output compare 5 function is enabled (no ic4). rtr[1:0] ? rti interrupt rate selects (refer to real-time interrupt ) addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset pulse accumulator control (pactl) $0026 0 paen pamodpedge 0 i4/o5 rtr1 rtr0 0000 0000 pamod pedge action of clock 0 0 pai falling edge increments the counter. 0 1 pai rising edge increments the counter. 1 0 a zero on pai inhibits counting. 1 1 a one on pai inhibits counting. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system pulse accumulator mc68hc11p2 ? rev 1.0 technical data timing system 8.8.2 pacnt ? pulse accumulator count register this 8-bit read/write register contains the count of external input events at the pai input, or the accumulated count. in gated time accumulation mode, pacnt is readable even if pai is not active. the counter is not affected by reset and can be read or written at any time. counting is synchronized to the internal ph2 clock so that incrementing and reading occur during opposite half cycles. 8.8.3 pulse accumulator status and interrupt bits the pulse accumulator control bits, paovi and paii, paovf, and paif are located within timer registers tmsk2 and tflg2. 8.8.3.1 tmsk2 ? timer interrupt mask 2 register 8.8.3.2 tflg2 ? timer interrupt flag 2 register paovi and paovf ? pulse accumulator interrupt enable and overflow flag the paovf status bit is set each time the pulse accumulator count rolls over from $ff to $00. to clear this status bit, write a one in the corresponding data bit position (bit 5) of the tflg2 register. the paovi control bit allows configuring the pulse accumulator overflow address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset pulse accumulator count (pacnt) $0027 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) undefined addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset timer interrupt mask 2 (tmsk2) $0024 toi rtii paovi paii 0 0 pr1 pr0 0000 0000 addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset timer interrupt flag 2 (tflg2) $0025 tof rtif paovf paif 0 0 0 0 0000 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system technical data mc68hc11p2 ? rev 1.0 timing system are inhibited, and the system operates in a polled mode, which requires that paovf be polled by user software to determine when an overflow has occurred. when the paovi control bit is set, a hardware interrupt request is generated each time paovf is set. before leaving the interrupt service routine, software must clear paovf by writing to the tflg2 register. paii and paif ? pulse accumulator input edge interrupt enable and flag the paif status bit is automatically set each time a selected edge is detected at the pa7/pai/oc1 pin. to clear this status bit, write to the tflg2 register with a one in the corresponding data bit position (bit 4). the paii control bit allows configuring the pulse accumulator input edge detect for polled or interrupt-driven operation but does not affect setting or clearing the paif bit. when paii is zero, pulse accumulator input interrupts are inhibited, and the system operates in a polled mode. in this mode, the paif bit must be polled by user software to determine when an edge has occurred. when the paii control bit is set, a hardware interrupt request is generated each time paif is set. before leaving the interrupt service routine, software must clear paif by writing to the tflg register. 8.9 pulse-width modulation (pwm) timer the pwm timer subsystem provides up to four 8-bit pulse-width modulated waveforms on the port h pins. channel pairs can be concatenated to create 16-bit pwm outputs. three clock sources (a, b, and s) and a flexible clock select scheme give the pwm a wide range of frequencies. pin alternate function ph0 pw1 ph1 pw2 ph2 pw3 ph3 pw4 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system pulse-width modulation (pwm) timer mc68hc11p2 ? rev 1.0 technical data timing system for the pwm clock sources and enables the 16-bit pwm functions. the pwpol register determines each channel ? s polarity and selects the clock source for each channel. the pwscal register derives a user- scaled clock based on the a clock source, and the pwen register enables the pwm channels. each channel also has a separate 8-bit counter, period register, and duty cycle register. the period and duty cycle registers are double buffered so that if they are changed while the channel is enabled, the change does not take effect until the counter rolls over or the channel is disabled. a new period or duty cycle can be forced into effect immediately by writing to the period or duty cycle register and then writing to the counter. with pwms configured for 8-bit mode and e equal to 4mhz, pwm signals can be produced from 40 khz (1% duty cycle resolution) to less than 10 cycles per second (approximately 0.4% duty cycle resolution). by configuring the pwms for 16-bit mode with e equal to 4mhz, pwm periods greater than one minute are possible. in 16-bit mode, duty cycle resolution of up to 15 parts per million can be achieved (at a pwm frequency of 60hz). in the same system, a pwm frequency of 1khz corresponds to a duty cycle resolution of 0.025%. 8.9.1 pwm timer block diagram figure 8-4 shows the block diagram of the pwm timer subsystem. three different clock sources are selectable and provide inputs to the control registers. each of the four channels has a counter, a period register, and a duty register. the waveform output is the result of a match between the period register (pwperx) and the value in the counter (pwcntx). the duty register (pwdtyx) changes the state of the output during the period to determine the duty cycle. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system technical data mc68hc11p2 ? rev 1.0 timing system mcu e clock 8-bit comparator eq pwscal divider prescale select 1, 2, 4, 8, 16, 32, 64, 128 prescale select 1, 2, 4, 8 pckb1 pckb2 pckb3 pcka2 pcka1 8-bit counter 2 clock select clock select pwen3 pwen4 con34 clock b clock a clock s con12 pwen1 pwen2 pclk4 pclk3 pclk2 pclk1 reset 4 8 8-bit comparator eq ph0/ pw1 pwdty1 bit 0 bit 1 bit 2 bit 3 sq q r mux 8-bit comparator eq pwper1 8-bit comparator eq pwdty2 8-bit comparator eq pwper2 carry sq q r mux 16-bit pwm control reset reset ppol2 ppol1 con12 8-bit comparator eq pwdty3 sq q r mux 8-bit comparator eq pwper3 8-bit comparator eq pwdty4 8-bit comparator eq pwper4 carry sq q r mux 16-bit pwm control reset reset ppol4 ppol3 con34 port h pin control ph1/ pw2 ph2/ pw3 ph3/ pw4 pwcnt3 pwcnt4 pwcnt2 pwcnt1 cnt1 cnt2 cnt3 cnt4 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system pulse-width modulation (pwm) timer mc68hc11p2 ? rev 1.0 technical data timing system 8.9.2 pwclk ? pwm clock prescaler and 16-bit select register this register contains bits for selecting the 16-bit pwm options and for selecting the prescaler values for the clocks. 8.9.2.1 16-bit pwm function the pwclk register contains two control bits, each of which is used to concatenate a pair of pwm channels into one 16-bit channel. channels 3 and 4 are concatenated with the con34 bit, and channels 1 and 2 are concatenated with the con12 bit. when the 16-bit concatenated mode is selected, the clock source is determined by the low order channel. channel 2 is the low order channel when channels 1 and 2 are concatenated. channel 4 is the low order channel when channels 3 and 4 are concatenated. the pins associated with channels 1 and 3 can be used for general-purpose i/o when 16-bit pwm mode is selected. channel 1 registers are the high order byte of the double-byte channel when channels 1 and 2 are concatenated. channel 3 registers are the high order byte of the double-byte channel when channels 3 and 4 are concatenated. reads of the high order byte cause the low order byte to be latched for one cycle to guarantee that double byte reads are accurate. writes to the low byte of the counter cause reset of the entire counter. writes to the upper bytes of the counter have no effect. con34 ? concatenate channels 3 and 4 1 = channels 3 and 4 are concatenated into one 16-bit pwm channel. 0 = channels 3 and 4 are separate 8-bit pwms. when concatenated, channel 3 is the high-order byte and the channel 4 pin (ph3) is the output. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset pulse width clock select (pwclk) $0060 con34con12pcka2pcka1 0 pckb3pckb2pckb1 0000 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system technical data mc68hc11p2 ? rev 1.0 timing system con12 ? concatenate channels 1 and 2 1 = channels 1 and 2 are concatenated into one 16-bit pwm channel. 0 = channels 1 and 2 are separate 8-bit pwms. when concatenated, channel 1 is the high-order byte and the channel 2 pin (ph1) is the output. 8.9.2.2 clock prescaler selection the three available clocks are clock a, clock b, and clock s (scaled). clock a can be software selected to be e, e/2, e/4, or e/8. clock b can be software selected to be e, e/2, e/4,..., e/128. the scaled clock (clock s) uses clock a as an input and divides it with a reloadable counter. the rates available are software selectable to be clock a/2, down to clock a /512. the clock source portion of the block diagram shows the three clock sources and how the scaled clock is created. clock a is an input to an 8- bit counter which is then compared to a user programmable scale value. when they match, this circuit has an output that is divided by two and the counter is reset. each pwm timer channel can be driven by one of two clocks. refer to figure 8-4 . pcka[2:1] ? prescaler for clock a determines the frequency of clock a. refer to table 8-4 . bit 3 ? not implemented; always reads zero pckb[3:1] ? prescaler for clock b determines the frequency of clock b. refer to table 8-4 . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system pulse-width modulation (pwm) timer mc68hc11p2 ? rev 1.0 technical data timing system 8.9.3 pwpol ? pwm timer polarity & clock source select register pclk[4:3] ? pulse width channel 4/3 clock select 1 = clock s is source. 0 = clock b is source. pclk[2:1] ? pulse width channel 2/1 clock select 1 = clock s is source. 0 = clock a is source. ppol[4:1] ? pulse width channel x polarity 1 = pwm channel x output is high at the beginning of the clock cycle and goes low when duty count is reached. 0 = pwm channel x output is low at the beginning of the clock cycle and goes high when duty count is reached. each channel has a polarity bit that allows a cycle to start with either a high or a low level. this is shown on the block diagram, figure 8-4 , as a selection of either the q output or the q output of the pwm output flip flop. when one of the bits in the pwpol register is set, the associated pwm channel output is high at the beginning of the clock cycle, then goes low when the duty count is reached. table 8-4. clock a and clock b prescalers pcka[2:1] clock a pckb[3:1] clock b 0 0 e 0 0 0 e 0 1 e/2 0 0 1 e/2 1 0 e/4 0 1 0 e/4 1 1 e/8 0 1 1 e/8 1 0 0 e/16 1 0 1 e/32 1 1 0 e/64 1 1 1 e/128 address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset pulse width polarity select (pwpol) $0061 pclk4 pclk3 pclk2 pclk1 ppol4 ppol3 ppol2 ppol1 0000 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system technical data mc68hc11p2 ? rev 1.0 timing system 8.9.4 pwscal ? pwm timer prescaler register scaled clock s is generated by dividing clock a by the value in pwscal, then dividing the result by two. if pwscal = $00, clock a is divided by 256, then divided by two to generate clock s. 8.9.5 pwen ? pwm timer enable register each timer has an enable bit to start its waveform output. writing any of these pwenx bits to one causes the associated port line to become an output regardless of the state of the associated ddr bit. this does not change the state of the ddr bit and when pwenx returns to zero the ddr bit again controls i/o state. on the front end of the pwm timer the clock is connected to the pwm circuit by the pwenx enable bit being high. there is a synchronizing circuit to guarantee that the clock will only be enabled or disabled at an edge. pwen contains 4 pwm enable bits ? one for each channel. when an enable bit is set to one, the pulse modulated signal becomes available at the associated port pin. tpwsl ? pwm scaled clock test bit (test mode only) 1 = clock s output to pwscal register (test only). 0 = normal operation. when tpwsl is one, clock s from the pwm timer is output to pwscal register. normal writing to the pwscal register still functions. discp ? disable compare scaled e clock (test mode only) 1 = match of period does not reset associated count register (test addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset pulse width scale (pwscal) $0062 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 0000 0000 addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset pulse width enable (pwen) $0063 tpwsl discp 0 0 pwen4pwen3pwen2pwen10000 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system pulse-width modulation (pwm) timer mc68hc11p2 ? rev 1.0 technical data timing system bits [5:4] ? not implemented; always read zero pwen[4:1] ? pulse width channels 4 ? 1 1 = channel enabled on the associated port pin. 0 = channel disabled. 8.9.6 pwcnt1 ? 4 ? pwm timer counter registers 1 to 4 each channel has its own counter which can be read at any time without affecting the count or the operation of the pwm channel. writing to a counter causes it to be reset to $00; this is generally done before the counter is enabled. a counter may also be written to whilst it is enabled; this may cause a truncated pwm period. 8.9.7 pwper1 ? 4 ? pwm timer period registers 1 to 4 there is one period register for each channel. the value in this register determines the period of the associated pwm timer channel. pwperx is connected internally to a buffer which compares directly with the counter register. the period value in pwperx is loaded into the buffer when the counter is cleared by the termination of the previous period or by a write to the counter. this register can be written at any time, and the written value will take effect from the start of the next pwm timer cycle. addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset pulse width count 1 (pwcnt1) $0064 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 0000 0000 pulse width count 2 (pwcnt2) $0065 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 0000 0000 pulse width count 3 (pwcnt3) $0066 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 0000 0000 pulse width count 4 (pwcnt4) $0067 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 0000 0000 addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset pulse width period 1 (pwper1) $0068 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 pulse width period 2 (pwper2) $0069 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 pulse width period 3 (pwper3) $006a (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 pulse width period 4 (pwper4) $006b (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system technical data mc68hc11p2 ? rev 1.0 timing system 8.9.8 pwdty1 ? 4 ? pwm timer duty cycle registers 1 to 4 there is one duty register for each channel. the value in this register determines the duty cycle of the associated pwm timer channel. pwdtyx is compared to the counter contents and if they are equal, a match occurs and the output goes to the state defined by the associated polarity bit. if the register is written while the channel is enabled, then the new value is held in a buffer until the counter rolls over or the channel is disabled. reads of this register return the most recent value written. note: if pwdtyx ? pwperx then there will be no change of state due to the duty cycle value. in addition, if the duty register is set to $00, then the output will always be in the state which would normally be result from the duty change of state (see also boundary cases ). addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset pulse width duty 1 (pwdty1) $006c (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 pulse width duty 2 (pwdty2) $006d (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 pulse width duty 3 (pwdty3) $006e (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 pulse width duty 4 (pwdty4) $006f (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 figure 8-5. pwm duty cycle pwmx pwperx pwdtyx f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system pulse-width modulation (pwm) timer mc68hc11p2 ? rev 1.0 technical data timing system 8.9.9 boundary cases the following boundary conditions apply to the values stored in the pwdtyx and pwperx registers and the ppolx bits:  if pwdtyx = $00, pwperx > $00 and ppolx = 0 then the output is always high.  if pwdtyx = $00, pwperx > $00 and ppolx = 1 then the output is always low.  if pwdtyx ? pwperx and ppolx = 0 then the output is always low.  if pwdtyx ? pwperx and ppolx = 1 then the output is always high.  if pwperx = $00 and ppolx = 0 then the output is always low.  if pwperx = $00 and ppolx = 1 then the output is always high. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system technical data mc68hc11p2 ? rev 1.0 timing system f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc11p2 ? rev 1.0 technical data analog-to-digital converter technical data ? mc68hc11p2 section 9. analog-to-digital converter 9.1 contents 9.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 9.3 overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 9.4 a/d converter power-up and clock select . . . . . . . . . . . . . 178 9.5 channel assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 9.6 control, status and results registers . . . . . . . . . . . . . . . . . 181 9.7 operation in stop and wait modes . . . . . . . . . . . . . . . . . 184 9.2 introduction the analog-to-digital (a/d) system, a successive approximation converter, uses an all-capacitive charge redistribution technique to convert analog signals to digital values. the a/d converter shares input pins with port e: pin alternate function pe0 ad0 pe1 ad1 pe2 ad2 pe3 ad3 pe4 ad4 pe5 ad5 pe6 ad6 pe7 ad7 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
analog-to-digital converter technical data mc68hc11p2 ? rev 1.0 analog-to-digital converter 9.3 overview the a/d system is an 8-channel, 8-bit, multiplexed-input converter. the vdd ad and vss ad pins are used to input supply voltage to the a/d converter. this allows the supply voltage to be bypassed independently. the converter does not require external sample and hold circuits because of the type of charge redistribution technique used. a/d converter timing can be synchronized to the system e clock, or to an internal resistor capacitor (rc) oscillator. the a/d converter system consists of four functional blocks: multiplexer, analog converter, digital control and result storage. refer to figure 9-1 . pe0/ ad0 pe1/ ad1 pe2/ ad2 pe3/ ad3 pe4/ ad4 pe5/ ad5 pe6/ ad6 pe7/ ad7 ccf 0 scan mult cd cc cb ca adctl ? a/d control analog mux result register interface adr1 - a/d result 1 adr2 - a/d result 2 adr3 - a/d result 3 adr4 - a/d result 4 successive approximation register and control 8-bit capacitive dac with sample and hold vrh vrl result internal data bus f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
analog-to-digital converter overview mc68hc11p2 ? rev 1.0 technical data analog-to-digital converter 9.3.1 multiplexer the multiplexer selects one of 16 inputs for conversion. input selection is controlled by the value of bits cd ? ca in the adctl register. the eight port e pins are fixed-direction analog inputs to the multiplexer, and additional internal analog signal lines are routed to it. port e pins can also be used as digital inputs. digital reads of port e pins are not recommended during the sample portion of an a/d conversion cycle, when the gate signal to the n-channel input gate is on. because no p-channel devices are directly connected to either input pins or reference voltage pins, voltages above v dd do not cause a latchup problem, although current should be limited according to maximum ratings. refer to figure 9-2 , which is a functional diagram of an input pin. figure 9-2. electrical model of an a/d input pin (in sample mode) e 4k ? <2pf v rl analog input 400na junction leakage diffusion and poly coupler 20pf dac capacitance note 1: the analog switch is closed only during the 12 cycle sample time note 1 input protection device +20v ? 0.7v note 2: all component values are approximate f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
analog-to-digital converter technical data mc68hc11p2 ? rev 1.0 analog-to-digital converter 9.3.2 analog converter conversion of an analog input selected by the multiplexer occurs in this block. it contains a digital-to-analog capacitor (dac) array, a comparator, and a successive approximation register (sar). each conversion is a sequence of eight comparison operations, beginning with the most significant bit (msb). each comparison determines the value of a bit in the sar. the dac array performs two functions. it acts as a sample and hold circuit during the entire conversion sequence, and provides comparison voltage to the comparator during each successive comparison. the result of each successive comparison is stored in the sar. when a conversion sequence is complete, the contents of the sar are transferred to the appropriate result register. a charge pump provides switching voltage to the gates of analog switches in the multiplexer. charge pump output must stabilize between 7 and 8 volts within up to 100 s before the converter can be used. the charge pump is enabled by the adpu bit in the option register. 9.3.3 digital control all a/d converter operations are controlled by bits in register adctl. in addition to selecting the analog input to be converted, adctl bits indicate conversion status, and control whether single or continuous conversions are performed. finally, the adctl bits determine whether conversions are performed on single or multiple channels. 9.3.4 result registers four 8-bit registers (adr1 ? adr4) store conversion results. each of these registers can be accessed by the processor in the cpu. the conversion complete flag (ccf) indicates when valid data is present in the result registers. the result registers are written during a portion of the system clock cycle when reads do not occur, so there is no conflict. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
analog-to-digital converter overview mc68hc11p2 ? rev 1.0 technical data analog-to-digital converter 9.3.5 a/d converter clocks the csel bit in the option register selects whether the a/d converter uses the system e clock or an internal rc oscillator for synchronization. when e clock frequency is below 750khz, charge leakage in the capacitor array can cause errors, and the internal oscillator should be used. when the rc clock is used, additional errors can occur because the comparator is sensitive to the additional system clock noise. 9.3.6 conversion sequence a/d converter operations are performed in sequences of four conversions each. a conversion sequence can repeat continuously or stop after one iteration. the conversion complete flag (ccf) is set after the fourth conversion in a sequence to show the availability of data in the result registers. figure 9-3 shows the timing of a typical sequence. synchronization is referenced to the system e clock. 9.3.7 conversion process the a/d conversion sequence begins one e clock cycle after a write to the a/d control/status register, adctl. the bits in adctl select the figure 9-3. a/d conversion sequence e clock sample analog input successive approximation sequence 12 cycles 4 cycles 2 cyc 2 cyc 2 cyc 2 cyc 2 cyc 2 cyc 2 cyc 2 cyc msb bit 6bit 5bit 4bit 3bit 2bit 1bit 0 end write to adctl convert first channel and update adr1 convert second channel and update adr2 convert third channel and update adr3 convert fourth channel and update adr4 set ccf flag repeat sequence if scan = 1 0 32 64 96 128 e clock cycles f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
analog-to-digital converter technical data mc68hc11p2 ? rev 1.0 analog-to-digital converter an input voltage equal to v rl converts to $00 and an input voltage equal to v rh converts to $ff (full scale), with no overflow indication. for ratiometric conversions of this type, the source of each analog input should use v rh as the supply voltage and be referenced to v rl . 9.4 a/d converter power-up and clock select adpu (bit 7 of the option register) controls a/d converter power up. clearing adpu removes power from and disables the a/d converter system; setting adpu enables the a/d converter system. after the a/d converter is turned on, the analog bias voltages will take up to 100s to stabilize. when the a/d converter system is operating from the mcu e clock, all switching and comparator operations are synchronized to the mcu clocks. this allows the comparator results to be sampled at ? quiet ? times, which minimizes noise errors. the internal rc oscillator is asynchronous with respect to the mcu clock, so noise can affect the a/d converter results. this results in a slightly lower typical accuracy when using the internal oscillator (csel = 1). 9.4.1 option ? system configuration options register 1 the 8-bit special-purpose option register sets internal system configuration options during initialization. the time protected control bits, irqe, dly, fcme and cr[1:0] can be written to only once in the first 64 cycles after a reset and then they become read-only bits. this minimizes the possibility of any accidental changes to the system configuration. they may be written at any time in special modes. adpu ? a/d power-up 1 = a/d system power enabled. addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset system config. options 1 (option) $0039 adpu csel irqe dly cme fcme cr1 cr0 0001 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
analog-to-digital converter a/d converter power-up and clock select mc68hc11p2 ? rev 1.0 technical data analog-to-digital converter after enabling the a/d power, at least 100s should be allowed for system stabilization. csel ? clock select 1 = a/d and eeprom use internal rc clock source (about 1.5mhz). 0 = a/d and eeprom use system e clock (must be at least 1mhz). selects alternate clock source for on-chip eeprom and a/d charge pumps. the on-chip rc clock should be used when the e clock frequency falls below 1mhz. irqe ? configure irq for falling edge sensitive operation (refer to operating modes and on-chip memory ) 1 = falling edge sensitive operation. 0 = low level sensitive operation. dly ? enable oscillator start-up delay 1 = a delay of approximately 4000 e clock cycles is imposed as the mcu is started up from the stop mode. 0 = the oscillator start-up delay coming out of stop is bypassed and the mcu resumes processing within about four bus cycles. a stable external oscillator is required if this option is selected. cme ? clock monitor enable (refer to resets and interrupts ) 1 = clock monitor enabled. 0 = clock monitor disabled. fcme ? force clock monitor enable (refer to resets and interrupts ) 1 = clock monitor enabled, cannot be disabled until next reset. 0 = clock monitor follows the state of the cme bit. cr[1:0] ? cop timer rate select bits (refer to resets and interrupts ) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
analog-to-digital converter technical data mc68hc11p2 ? rev 1.0 analog-to-digital converter 9.5 channel assignments the multiplexer allows the a/d converter to select one of sixteen analog signals. eight of these channels correspond to port e input lines to the mcu, four others are internal reference points or test functions; the remaining four channels are reserved. refer to table 9-1 . 9.5.1 single-channel operation there are two types of single-channel operation. in the first type (scan = 0), the single selected channel is converted four consecutive times. the first result is stored in a/d result register 1 (adr1), and the fourth result is stored in adr4. after the fourth conversion is complete, all conversion activity is halted until a new conversion command is written to the adctl register. in the second type of single-channel operation (scan = 1), conversions continue to be performed on the selected channel with the fifth conversion being stored in register adr1 (overwriting the first conversion result), the sixth conversion overwriting table 9-1. a/d converter channel assignments channel number channel signal result in adrx if mult = 1 1 an0 adr1 2 an1 adr2 3 an2 adr3 4 an3 adr4 5 an4 adr1 6 an5 adr2 7 an6 adr3 8 an7 adr4 9 ? 12 reserved ? 13 v rh (1) 1. used for factory testing. adr1 14 v rl * adr2 15 v rh /2 * adr3 16 reserved * adr4 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
analog-to-digital converter control, status and results registers mc68hc11p2 ? rev 1.0 technical data analog-to-digital converter 9.5.2 multiple-channel operation there are two types of multiple-channel operation. in the first type (scan = 0), a selected group of four channels is converted once only. the first result is stored in a/d result register 1 (adr1), and the fourth result is stored in adr4. after the fourth conversion is complete, all conversion activity is halted until a new conversion command is written to the adctl register. in the second type of multiple-channel operation (scan = 1), conversions continue to be performed on the selected group of channels with the fifth conversion being stored in register adr1 (replacing the earlier conversion result for the first channel in the group), the sixth conversion overwriting adr2, and so on. 9.6 control, status and results registers 9.6.1 adctl ? a/d control and status register all bits in this register can be read or written, except bit 7, which is a read- only status indicator, and bit 6, which always reads as zero. write to adctl to initiate a conversion. to quit a conversion in progress, write to this register and a new conversion sequence begins immediately. ccf ? conversions complete flag 1 = all four a/d result registers contain valid conversion data. 0 = at least one of the a/d result registers contains invalid data. a read-only status indicator, this bit is set when all four a/d result registers contain valid conversion results. each time the adctl register is overwritten, this bit is automatically cleared to zero and a conversion sequence is started. in the continuous mode, ccf is set at the end of the first conversion sequence. bit 6 ? not implemented; always reads zero. addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset a/d control & status (adctl) $0030 ccf 0 scan mult cd cc cb ca u0uu uuuu f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
analog-to-digital converter technical data mc68hc11p2 ? rev 1.0 analog-to-digital converter scan ? continuous scan control 1 = a/d conversions take place continuously. 0 = each of the four conversions is performed only once. when this control bit is clear, the four requested conversions are performed once to fill the four result registers. when this control bit is set, conversions continue in a round-robin fashion with the result registers updated as data becomes available. mult ? multiple-channel/single-channel control 1 = each a/d channel has a result register allocated to it. 0 = four consecutive conversions from the same a/d channel are stored in the results registers. when this bit is clear, the a/d converter system is configured to perform four consecutive conversions on the single channel specified by the four channel select bits cd ? ca (bits 3 ? 0 of the adctl register). when this bit is set, the a/d system is configured to perform a conversion on each of four channels where each result register corresponds to one channel. note: when the multiple-channel continuous scan mode is used, extra care is needed in the design of circuitry driving the a/d inputs. the charge on the capacitive dac array before the sample time is related to the voltage on the previously converted channel. a charge share situation exists between the internal dac capacitance and the external circuit capacitance. although the amount of charge involved is small, the rate at which it is repeated is every 64 s for an e clock of 2 mhz. the rc charging rate of the external circuit must be balanced against this charge sharing effect to avoid errors in accuracy. refer to the m68hc11 reference manual (m68hc11rm/ad) for further information. cd ? ca ? channel selects d ? a when a multiple channel mode is selected (mult = 1), the two least significant channel select bits (cb and ca) have no meaning and the cd and cc bits specify which group of four channels is to be converted. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
analog-to-digital converter control, status and results registers mc68hc11p2 ? rev 1.0 technical data analog-to-digital converter 9.6.2 adr1 ? adr4 ? a/d converter results registers these read-only registers hold an 8-bit conversion result. writes to these registers have no effect. data in the a/d converter result registers is valid when the ccf flag in the adctl register is set, indicating a conversion sequence is complete. if conversion results are needed sooner, refer to figure 9-3 , which shows the a/d conversion sequence diagram. channel select control bits channel signal result in adrx if mult = 1 cd:cc:cb:ca 0 0 0 0 an0 adr1 0 0 0 1 an1 adr2 0 0 1 0 an2 adr3 0 0 1 1 an3 adr4 0 1 0 0 an4 adr1 0 1 0 1 an5 adr2 0 1 1 0 an6 adr3 0 1 1 1 an7 adr4 1 0 x x reserved ? 1 1 0 0 v rh (1) adr1 1 1 0 1 v rl (1) adr2 1 1 1 0 v rh /2 (1) adr3 1 1 1 1 reserved (1) adr4 1. used for factory testing. addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset a/d result 1 (adr1) $0031 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) undefined a/d result 2 (adr2) $0032 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) undefined a/d result 3 (adr3) $0033 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) undefined a/d result 4 (adr4) $0034 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) undefined f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
analog-to-digital converter technical data mc68hc11p2 ? rev 1.0 analog-to-digital converter 9.7 operation in stop and wait modes if a conversion sequence is in progress when either the stop or wait mode is entered, the conversion of the current channel is suspended. when the mcu resumes normal operation, that channel is resampled and the conversion sequence is resumed. as the mcu exits the wait mode, the a/d circuits are stable and valid results can be obtained on the first conversion. however, in stop mode, all analog bias currents are disabled and it is necessary to allow a stabilization period when leaving the stop mode. if the stop mode is exited with a delay (dly = 1), there is enough time for these circuits to stabilize before the first conversion. if the stop mode is exited with no delay (dly bit in option register = 0), allow 10 ms for the a/d circuitry to stabilize to avoid invalid results. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc11p2 ? rev 1.0 technical data resets and interrupts technical data ? mc68hc11p2 section 10. resets and interrupts 10.1 contents 10.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 10.3 resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 10.4 effects of reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 10.5 reset and interrupt priority . . . . . . . . . . . . . . . . . . . . . . . . . 195 10.6 interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200 10.7 low power operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 10.2 introduction resets and interrupt operations load the program counter with a vector that points to a new location from which instructions are to be fetched. a reset immediately stops execution of the current instruction and forces the program counter to a known starting address. internal registers and control bits are initialized so that the mcu can resume executing instructions. an interrupt temporarily suspends normal program execution whilst an interrupt service routine is being executed. after an interrupt has been serviced, the main program resumes as if there had been no interruption. 10.3 resets there are four possible sources of reset. power-on reset (por) and external reset share the normal reset vector. the computer operating properly (cop) reset and the clock monitor reset each has its own f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts technical data mc68hc11p2 ? rev 1.0 resets and interrupts 10.3.1 power-on reset a positive transition on vdd generates a power-on reset (por), which is used only for power-up conditions. por cannot be used to detect drops in power supply voltages. a 4064 t cyc (internal clock cycle) delay after the oscillator becomes active allows the clock generator to stabilize. if reset is at logical zero at the end of 4064 t cyc , the cpu remains in the reset condition until reset goes to logical one. it is important to protect the mcu during power transitions. most m68hc11 systems need an external circuit that holds the reset pin low whenever v dd is below the minimum operating level. this external voltage level detector, or other external reset circuits, are the usual source of reset in a system. the por circuit only initializes internal circuitry during cold starts. refer to figure 2-2 . 10.3.2 external reset (reset ) the cpu distinguishes between internal and external reset conditions by sensing whether the reset pin rises to a logic one in less than two e clock cycles after an internal device releases reset. when a reset condition is sensed, the reset pin is driven low by an internal device for four e clock cycles, then released. two e clock cycles later it is sampled. if the pin is still held low, the cpu assumes that an external reset has occurred. if the pin is high, it indicates that the reset was initiated internally by either the cop system or the clock monitor. it is not advisable to connect an external resistor capacitor (rc) power-up delay circuit to the reset pin of m68hc11 devices because the circuit charge time constant can cause the device to misinterpret the type of reset that occurred. 10.3.3 cop reset the mcu includes a cop system to help protect against software failures. when the cop is enabled, the software is responsible for keeping a free-running watchdog timer from timing out. when the f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts resets mc68hc11p2 ? rev 1.0 technical data resets and interrupts the state of the nocop bit in the config register determines whether the cop system is enabled or disabled. to change the enable status of the cop system, change the contents of the config register and then perform a system reset. in the special test and bootstrap operating modes, the cop system is initially inhibited by the disable resets (disr) control bit in the test1 register. the disr bit can subsequently be written to zero to enable cop resets. the cop timer rate control bits cr[1:0] in the option register determine the cop timeout period. the system e clock is divided by 2 15 and then further scaled by a factor shown in table 10-1 . after reset, these bits are zero, which selects the shortest timeout period. in normal operating modes, these bits can only be written once within 64 bus cycles after reset. 10.3.4 coprst ? arm/reset cop timer circuitry register complete the following reset sequence to service the cop timer. write $55 to coprst to arm the cop timer clearing mechanism. then write $aa to coprst to clear the cop timer. executing instructions between table 10-1. cop timer rate select cr[1:0] divide e/2 15 by xtal = 8mhz: timeout (1) 1. the timeout period has a tolerance of ? 0/+one cycle of the e/2 15 clock due to the asynchronous implementation of the cop circuitry. for example, with xtal = 8mhz, the uncertainty is ? 0/+16.384ms. see also the m68hc11 reference manual, (m68hc11rm/ad) . xtal = 12mhz: timeout (1) xtal = 16mhz: timeout (1) 0 0 1 16.384 ms 10.923 ms 8.192 ms 0 1 4 65.536 ms 43.691 ms 32.768 ms 1 0 16 262.14 ms 174.76 ms 131.07 ms 1 1 64 1.049 sec 699.05 ms 524.29 ms e = 2.0 mhz 3.0 mhz 4.0 mhz addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset cop timer arm/reset (coprst) $003a (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) not affected f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts technical data mc68hc11p2 ? rev 1.0 resets and interrupts these two steps is possible as long as both steps are completed in the correct sequence before the timer times out. 10.3.5 clock monitor reset the clock monitor circuit is based on an internal rc time delay. if no mcu clock edges are detected within this rc time delay, the clock monitor can optionally generate a system reset. the clock monitor function is enabled or disabled by the cme control bit in the option register. the presence of a timeout is determined by the rc delay, which allows the clock monitor to operate without any mcu clocks. clock monitor is used as a backup for the cop system. because the cop needs a clock to function, it is disabled when the clocks stop. therefore, the clock monitor system can detect clock failures not detected by the cop system. semiconductor wafer processing causes variations of the rc timeout values between individual devices. an e clock frequency below 10 khz is detected as a clock monitor error. an e clock frequency of 200 khz or more prevents clock monitor errors. using the clock monitor function when the e clock is below 200 khz is not recommended. special considerations are needed when a stop instruction is executed and the clock monitor is enabled. because the stop function causes the clocks to be halted, the clock monitor function generates a reset sequence if it is enabled at the time the stop mode was initiated. before executing a stop instruction, clear the cme bit in the option register to zero to disable the clock monitor. after recovery from stop, set the cme bit to logic one to enable the clock monitor. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts resets mc68hc11p2 ? rev 1.0 technical data resets and interrupts 10.3.6 option ? system configuration options register 1 the special-purpose option register sets internal system configuration options during initialization. the time protected control bits (irqe, dly, fcme and cr[1:0]) can be written to only once in the first 64 cycles after a reset and then they become read-only bits. this minimizes the possibility of any accidental changes to the system configuration. they may be written at any time in special modes. adpu ? a/d power-up (refer to analog-to-digital converter ) 1 = a/d system power enabled. 0 = a/d system disabled, to reduce supply current. csel ? clock select (refer to analog-to-digital converter ) 1 = a/d and eeprom use internal rc clock source (about 1.5mhz). 0 = a/d and eeprom use system e clock (must be at least 1mhz). irqe ? configure irq for falling edge sensitive operation (refer to operating modes and on-chip memory ) 1 = falling edge sensitive operation. 0 = low level sensitive operation. dly ? enable oscillator start-up delay (refer to operating modes and on-chip memory ) 1 = a delay of approximately 4000 e clock cycles is imposed as the mcu is started up from the stop mode. 0 = the oscillator start-up delay coming out of stop is bypassed. cme ? clock monitor enable 1 = clock monitor enabled. 0 = clock monitor disabled. addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset system config. options 1 (option) $0039 adpu csel irqe dly cme fcme cr1 cr0 0001 0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts technical data mc68hc11p2 ? rev 1.0 resets and interrupts this control bit can be read or written at any time and controls whether or not the internal clock monitor circuit triggers a reset sequence when the system clock is slow or absent. when it is clear, the clock monitor circuit is disabled, and when it is set, the clock monitor circuit is enabled. reset clears the cme bit. in order to use both stop and clock monitor, the cme bit should be cleared before executing stop, then set again after recovering from stop. fcme ? force clock monitor enable 1 = clock monitor enabled; cannot be disabled until next reset. 0 = clock monitor follows the state of the cme bit. when fcme is set, slow or stopped clocks will cause a clock failure reset sequence. to utilize stop mode, fcme should always be cleared. cr[1:0] ? cop timer rate select bits the internal e clock is first divided by 2 15 before it enters the cop watchdog system. these control bits determine a scaling factor for the watchdog timer. see table 10-1 . 10.3.7 config ? configuration control register config controls the presence and location of eeprom in the memory map and enables the cop watchdog system. a security feature that protects data in eeprom and ram is available on mask programmed mcus. refer to ram and eeprom security . config is made up of eeprom cells and static working latches. the operation of the mcu is controlled directly by these latches and not the eeprom byte. when programming the config register, the eeprom byte is accessed. when the config register is read, the static latches address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset configuration control (config) $003f romad 1 1 parennosecnocopromon eeon x11x xxxx f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts resets mc68hc11p2 ? rev 1.0 technical data resets and interrupts these bits can be read at any time. the value read is the one latched into the register from the eeprom cells during the last reset sequence. a new value programmed into this register is not readable until after a subsequent reset sequence. unused bits always read as ones. if smod = 1, config bits can be written at any time. if smod = 0, config bits can only be written using the eeprom programming sequence, and are neither readable nor active until latched via the next reset. romad ? rom mapping control (refer to operating modes and on- chip memory ) 1 = rom addressed from $8000 to $ffff. 0 = rom addressed from $0000 to $7fff (expanded mode only). bits [6,5] ? not implemented; always read one paren ? pull-up assignment register enable (refer to parallel input/output ) 1 = ppar register enabled; pull-ups can be enabled using ppar. 0 = ppar register disabled; all pull-ups disabled. nosec ? eeprom security disabled (refer to operating modes and on-chip memory ) 1 = disable security. 0 = enable security. nocop ? cop system disable 1 = cop system disabled. 0 = cop system enabled (forces reset on timeout). romon ? rom enable (refer to operating modes and on-chip memory ) 1 = rom included in the memory map. 0 = rom excluded from the memory map. eeon ? eeprom enable (refer to operating modes and on-chip memory ) 1 = eeprom included in the memory map. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts technical data mc68hc11p2 ? rev 1.0 resets and interrupts 10.4 effects of reset when a reset condition is recognized, the internal registers and control bits are forced to an initial state. depending on the cause of the reset and the operating mode, the reset vector can be fetched from any of six possible locations, as shown in table 10-2 . these initial states then control on-chip peripheral systems to force them to known start-up states, as described in the following paragraphs. 10.4.1 central processing unit after reset, the cpu fetches the restart vector from the appropriate address during the first three cycles, and begins executing instructions. the stack pointer and other cpu registers are indeterminate immediately after reset; however, the x and i interrupt mask bits in the condition code register (ccr) are set to mask any interrupt requests. also, the s-bit in the ccr is set to inhibit the stop mode. 10.4.2 memory map after reset, the init register is initialized to $00, putting the 1024 bytes of ram at locations $0080 ? $047f, and the control registers at locations $0000 ? $007f. the init2 register puts eeprom at locations $0d80 ? $0fff. table 10-2. reset cause, reset vector and operating mode cause of reset normal mode vector special test or bootstrap por or reset pin $fffe, $ffff $bffe, $bfff clock monitor failure $fffc, $fffd $bffc, $bffd cop watchdog timeout $fffa, $fffb $bffa, $bffb f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts effects of reset mc68hc11p2 ? rev 1.0 technical data resets and interrupts 10.4.3 parallel i/o when a reset occurs in expanded operating modes, port b, c, and f pins used for parallel i/o are dedicated to the expansion bus. if a reset occurs during a single chip operating mode, all ports are configured as general- purpose high-impedance inputs. note: do not confuse pin function with the electrical state of the pin at reset. all general-purpose i/o pins configured as inputs at reset are in a high- impedance state. port data registers reflect the port ? s functional state at reset. the pin function is mode dependent. 10.4.4 timer during reset, the timer system is initialized to a count of $0000. the prescaler bits are cleared, and all output compare registers are initialized to $ffff. all input capture registers are indeterminate after reset. the output compare 1 mask (oc1m) register is cleared so that successful oc1 compares do not affect any i/o pins. the other four output compares are configured so that they do not affect any i/o pins on successful compares. all input capture edge-detector circuits are configured for capture disabled operation. the timer overflow interrupt flag and all eight timer function interrupt flags are cleared. all nine timer interrupts are disabled because their mask bits have been cleared. the i4/o5 bit in the pactl register is cleared to configure the i4/o5 function as oc5; however, the om5:ol5 control bits in the tctl1 register are clear so oc5 does not control the pa3 pin. 10.4.5 real-time interrupt (rti) the real-time interrupt flag (rtif) is cleared and automatic hardware interrupts are masked. the rate control bits are cleared after reset and can be initialized by software before the real-time interrupt (rti) system is used. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts technical data mc68hc11p2 ? rev 1.0 resets and interrupts 10.4.6 pulse accumulator the pulse accumulator system is disabled at reset so that the pulse accumulator input (pai) pin defaults to being a general-purpose input pin. 10.4.7 computer operating properly (cop) the cop watchdog system is enabled if the nocop control bit in the config register is cleared, and disabled if nocop is set. the cop rate is set for the shortest duration timeout. 10.4.8 serial communications interface (sci) the reset condition of the sci system is independent of the operating mode. at reset, the sci baud rate control register is initialized to $0004. all transmit and receive interrupts are masked and both the transmitter and receiver are disabled so the port pins default to being general purpose i/o lines. the sci frame format is initialized to an 8-bit character size. the send break and receiver wake-up functions are disabled. the tdre and tc status bits in the sci status register are both set, indicating that there is no transmit data in either the transmit data register or the transmit serial shift register. the rdrf, idle, or, nf, fe, pf, and raf receive-related status bits are cleared. note: the foregoing paragraph also applies to sci2 and sci3. their respective mi bus functions are disabled, since miex is cleared on reset. 10.4.9 serial peripheral interface (spi) the spi system is disabled by reset. the port pins associated with this function default to being general-purpose i/o lines. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts reset and interrupt priority mc68hc11p2 ? rev 1.0 technical data resets and interrupts 10.4.10 analog-to-digital converter the a/d converter configuration is indeterminate after reset. the adpu bit is cleared by reset, which disables the a/d system. the conversion complete flag is cleared by reset. 10.4.11 system the eeprom programming controls are disabled, so the memory system is configured for normal read operation. psel[4:0] are initialized with the binary value %00110, causing the external irq pin to have the highest i-bit interrupt priority. the irq pin is configured for level- sensitive operation (for wired-or systems). the rboot, smod, and mda bits in the hprio register reflect the status of the modb and moda inputs at the rising edge of reset. the dly control bit is set to specify that an oscillator start-up delay is imposed upon recovery from stop mode. the clock monitor system is disabled because cme and fcme are cleared. 10.5 reset and interrupt priority resets and interrupts have a hardware priority that determines which reset or interrupt is serviced first when simultaneous requests occur. any maskable interrupt can be given priority over other maskable interrupts. the first six interrupt sources are not maskable by the i-bit in the ccr. the priority arrangement for these sources is fixed and is as follows: 1. por or reset pin 2. clock monitor reset 3. cop watchdog reset 4. xirq interrupt ? illegal opcode interrupt ? see illegal opcode trap for details of handling f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts technical data mc68hc11p2 ? rev 1.0 resets and interrupts the maskable interrupt sources have the following priority arrangement: 1. irq 2. real-time interrupt 3. timer input capture 1 4. timer input capture 2 5. timer input capture 3 6. timer output compare 1 7. timer output compare 2 8. timer output compare 3 9. timer output compare 4 10. timer input capture 4/output compare 5 11. sci2/mi bus system 12. sci3/mi bus system 13. timer overflow 14. pulse accumulator overflow 15. pulse accumulator input edge 16. spi transfer complete 17. sci1 system any one of these maskable interrupts can be assigned the highest maskable interrupt priority by writing the appropriate value to the psel bits in the hprio register. otherwise, the priority arrangement remains the same. an interrupt that is assigned highest priority is still subject to global masking by the i-bit in the ccr, or by any associated local bits. interrupt vectors are not affected by priority assignment. to avoid race conditions, hprio can only be written while i-bit interrupts are inhibited. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts reset and interrupt priority mc68hc11p2 ? rev 1.0 technical data resets and interrupts 10.5.1 hprio ? highest priority i-bit interrupt and misc. register rboot, smod, and mda bits depend on power-up initialization mode and can only be written in special modes when smod = 1. refer to table 3-4 . rboot ? read bootstrap rom (refer to operating modes and on- chip memory ) 1 = bootloader rom enabled, at $be40 ? $bfff. 0 = bootloader rom disabled and not in map. smod ? special mode select (refer to operating modes and on-chip memory ) 1 = special mode variation in effect. 0 = normal mode variation in effect. mda ? mode select a (refer to operating modes and on-chip memory ) 1 = normal expanded or special test mode in effect. 0 = normal single chip or special bootstrap mode in effect. psel[4:0] ? priority select bits these bits select one interrupt source to be elevated above all other i-bit-related sources and can be written to only while the i-bit in the ccr is set (interrupts disabled). see table 10-3 . addressbit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 state on reset highest priority interrupt (hprio) $003c rboo t smod mda psel4 psel3 psel2 psel1 psel0 xxx0 0110 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts technical data mc68hc11p2 ? rev 1.0 resets and interrupts table 10-3. highest priority interrupt selection pselx interrupt source promoted 43210 0 0 0 x x reserved (default to irq ) 0 0 1 0 0 reserved (default to irq ) 0 0 1 0 1 reserved (default to irq ) 00110 irq (external pin) 0 0 1 1 1 real-time interrupt 0 1 0 0 0 timer input capture 1 0 1 0 0 1 timer input capture 2 0 1 0 1 0 timer input capture 3 0 1 0 1 1 timer output compare 1 0 1 1 0 0 timer output compare 2 0 1 1 0 1 timer output compare 3 0 1 1 1 0 timer output compare 4 0 1 1 1 1 timer output compare 5/input capture 4 1 0 0 0 0 timer overflow 1 0 0 0 1 pulse accumulator overflow 1 0 0 1 0 pulse accumulator input edge 1 0 0 1 1 spi serial transfer complete 1 0 1 0 0 sci1 serial system 1 0 1 0 1 sci2/mi bus serial system 1 0 1 1 0 sci3/mi bus serial system 1 0 1 1 1 reserved (default to irq ) 1 1 x x x reserved (default to irq ) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts reset and interrupt priority mc68hc11p2 ? rev 1.0 technical data resets and interrupts table 10-4. interrupt and reset vector assignments vector address interrupt source ccr mask bit local mask ffc0, c1 ? ffd0, d1 reserved ?? ffd2, d3  sci/mi bus3 receive data register full  sci/mi bus3 receiver overrun  sci3 transmit data register empty  sci3 transmit complete  sci3 idle line detect i rie3 rie3 tie3 tcie3 ilie3 ffd4, d5  sci/mi bus2 receive data register full  sci/mi bus2 receiver overrun  sci2 transmit data register empty  sci2 transmit complete  sci2 idle line detect i rie2 rie2 tie2 tcie2 ilie2 ffd6, d7  sci1 receive data register full  sci1 receiver overrun  sci1 transmit data register empty  sci1 transmit complete  sci1 idle line detect i rie rie tie tcie ilie ffd8, d9 spi serial transfer complete i spie ffda, db pulse accumulator input edge i paii ffdc, dd pulse accumulator overflow i paovi ffde, df timer overflow i toi ffe0, e1 timer input capture 4/output compare 5 i i4/o5i ffe2, e3 timer output compare 4 i oc4i ffe4, e5 timer output compare 3 i oc3i ffe6, e7 timer output compare 2 i oc2i ffe8, e9 timer output compare 1 i oc1i ffea, eb timer input capture 3 i ic3i ffec, ed timer input capture 2 i ic2i ffee, ef timer input capture 1 i ic1i fff0, f1 real-time interrupt i rtii fff2, f3 irq pin i none fff4, f5 xirq pin x none fff6, f7 software interrupt none none fff8, f9 illegal opcode trap none none fffa, fb cop failure none nocop fffc, fd clock monitor fail none cme fffe, ff reset none none f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts technical data mc68hc11p2 ? rev 1.0 resets and interrupts 10.6 interrupts excluding reset type interrupts, the mc68hc11p2 has 20 interrupt vectors that support 32 interrupt sources. the 17 maskable interrupts are generated by on-chip peripheral systems. these interrupts are recognized when the global interrupt mask bit (i) in the condition code register (ccr) is clear. the three nonmaskable interrupt sources are illegal opcode trap, software interrupt, and xirq pin. refer to table 10- 4 , which shows the interrupt sources and vector assignments for each source. for some interrupt sources, such as the sci interrupts, the flags are automatically cleared during the normal course of responding to the interrupt requests. for example, the rdrf flag in the sci system is cleared by the automatic clearing mechanism consisting of a read of the sci status register while rdrf is set, followed by a read of the sci data register. the normal response to an rdrf interrupt request would be to read the sci status register to check for receive errors, then to read the received data from the sci data register. these two steps satisfy the automatic clearing mechanism without requiring any special instructions. 10.6.1 interrupt recognition and register stacking an interrupt can be recognized at any time after it is enabled by its local mask, if any, and by the global mask bit in the ccr. once an interrupt source is recognized, the cpu responds at the completion of the instruction being executed. interrupt latency varies according to the number of cycles required to complete the current instruction. when the cpu begins to service an interrupt, the contents of the cpu registers are pushed onto the stack in the order shown in table 10-5 . after the ccr value is stacked, the i-bit and the x-bit, if xirq is pending, are set to inhibit further interrupts. the interrupt vector for the highest priority pending source is fetched, and execution continues at the address specified by the vector. at the end of the interrupt service routine, the return from interrupt instruction is executed and the saved registers are f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts interrupts mc68hc11p2 ? rev 1.0 technical data resets and interrupts can resume. refer to cpu core and instruction set for further information. 10.6.2 nonmaskable interrupt request (xirq ) nonmaskable interrupts are useful because they can always interrupt cpu operations. the most common use for such an interrupt is for serious system problems, such as program runaway or power failure. the xirq input is an updated version of the nmi (nonmaskable interrupt) input of earlier mcus. upon reset, both the x-bit and i-bit of the ccr are set to inhibit all maskable interrupts and xirq . after minimum system initialization, software can clear the x-bit by a tap instruction, enabling xirq interrupts. thereafter, software cannot set the x-bit. thus, an xirq interrupt is a nonmaskable interrupt. because the operation of the i-bit- related interrupt structure has no effect on the x-bit, the internal xirq pin remains unmasked. in the interrupt priority logic, the xirq interrupt has a higher priority than any source that is maskable by the i-bit. all i- bit-related interrupts operate normally with their own priority relationship. when an i-bit-related interrupt occurs, the i-bit is automatically set by hardware after stacking the ccr byte. the x-bit is not affected. when an x-bit-related interrupt occurs, both the x and i bits are automatically table 10-5. stacking order on entry to interrupts memory location cpu registers sp pcl sp ? 1pch sp ? 2iyl sp ? 3iyh sp ? 4ixl sp ? 5ixh sp ? 6acca sp ? 7accb sp ? 8ccr f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts technical data mc68hc11p2 ? rev 1.0 resets and interrupts 10.6.3 illegal opcode trap because not all possible opcodes or opcode sequences are defined, the mcu includes an illegal opcode detection circuit, which generates an interrupt request. when an illegal opcode is detected and the interrupt is recognized, the current value of the program counter is stacked. after interrupt service is complete, the user should reinitialize the stack pointer to ensure that repeated execution of illegal opcodes does not cause stack underflow. left uninitialized, the illegal opcode vector can point to a memory location that contains an illegal opcode. this condition causes an infinite loop that causes stack underflow. the stack grows until the system crashes. the illegal opcode trap mechanism works for all unimplemented opcodes on all four opcode map pages. the address stacked as the return address for the illegal opcode interrupt is the address of the first byte of the illegal opcode. otherwise, it would be almost impossible to determine whether the illegal opcode had been one or two bytes. the stacked return address can be used as a pointer to the illegal opcode, so that the illegal opcode service routine can evaluate the offending opcode. 10.6.4 software interrupt swi is an instruction, and thus cannot be interrupted until complete. swi is not inhibited by the global mask bits in the ccr. because execution of swi sets the i mask bit, once an swi interrupt begins, other interrupts are inhibited until swi is complete, or until user software clears the i bit in the ccr. 10.6.5 maskable interrupts the maskable interrupt structure of the mcu can be extended to include additional external interrupt sources through the irq pin. the default configuration of this pin is a low-level sensitive wired-or network. when an event triggers an interrupt, a software accessible interrupt flag is set. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts low power operation mc68hc11p2 ? rev 1.0 technical data resets and interrupts 10.6.6 reset and interrupt processing the following flow diagrams illustrate the reset and interrupt process. figure 10-1 and figure 10-2 illustrate how the cpu begins from a reset and how interrupt detection relates to normal opcode fetches. figure 10- 3 to figure 10-4 provide an expanded version of a block in figure 10-1 and illustrate interrupt priorities. figure 10-6 shows the resolution of interrupt sources within the sci subsystem. 10.7 low power operation both stop and wait suspend cpu operation until a reset or interrupt occurs. the wait condition suspends processing and reduces power consumption to an intermediate level. the stop condition turns off all on-chip clocks and reduces power consumption to an absolute minimum while retaining the contents of all bytes of the ram. 10.7.1 wait the wai opcode places the mcu in the wait condition, during which the cpu registers are stacked and cpu processing is suspended until a qualified interrupt is detected. the interrupt can be an external irq , an xirq , or any of the internally generated interrupts, such as the timer or serial interrupts. the on-chip crystal oscillator remains active throughout the wait stand-by period. the reduction of power in the wait condition depends on how many internal clock signals driving on-chip peripheral functions can be shut down. the cpu is always shut down during wait. while in the wait state, the address/data bus repeatedly runs read cycles to the address where the ccr contents were stacked. the mcu leaves the wait state when it senses any interrupt that has not been masked. the free-running timer system is shut down only if the i-bit is set to one and the cop system is disabled by nocop being set to one. several other systems can also be in a reduced power consumption state f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts technical data mc68hc11p2 ? rev 1.0 resets and interrupts affected significantly by the wait condition. however, the a/d converter current can be eliminated by writing the adpu bit to zero. the spi system is enabled or disabled by the spe control bit. the sci transmitter is enabled or disabled by the te bit, and the sci receiver is enabled or disabled by the re bit. therefore the power consumption in wait is dependent on the particular application. 10.7.2 stop executing the stop instruction while the s-bit in the ccr is equal to zero places the mcu in the stop condition. if the s-bit is not zero, the stop opcode is treated as a no-op (nop). the stop condition offers minimum power consumption because all clocks, including the crystal oscillator, are stopped while in this mode. to exit stop and resume normal processing, a logic low level must be applied to one of the external interrupts (irq or xirq ) or to the reset pin. a pending edge- triggered irq can also bring the cpu out of stop. because all clocks are stopped in this mode, all internal peripheral functions also stop. the data in the internal ram is retained as long as v dd power is maintained. the cpu state and i/o pin levels are static and are unchanged by stop. therefore, when an interrupt comes to restart the system, the mcu resumes processing as if there were no interruption. if reset is used to restart the system a normal reset sequence results where all i/o pins and functions are also restored to their initial states. to use the irq pin as a means of recovering from stop, the i-bit in the ccr must be clear (irq not masked). the xirq pin can be used to wake up the mcu from stop regardless of the state of the x-bit in the ccr, although the recovery sequence depends on the state of the x-bit. if x is set to zero (xirq not masked), the mcu starts up, beginning with the stacking sequence leading to normal service of the xirq request. if x is set to one (xirq masked or inhibited), then processing continues with the instruction that immediately follows the stop instruction, and no xirq interrupt service is requested or pending. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts low power operation mc68hc11p2 ? rev 1.0 technical data resets and interrupts internal oscillator is being used, this delay is required; however, if a stable external oscillator is being used, the dly control bit can be used to bypass this start-up delay. the dly control bit is set by reset and can be optionally cleared during initialization. if the dly equal to zero option is used to avoid start-up delay on recovery from stop, then reset should not be used as the means of recovering from stop, as this causes dly to be set again by reset, imposing the restart delay. this same delay also applies to power-on-reset, regardless of the state of the dly control bit, but does not apply to a reset while the clocks are running. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts technical data mc68hc11p2 ? rev 1.0 resets and interrupts xirq pin low? clock monitor fail (cme = 1) cop watchdog timeout (nocop = 0) begin an instruction sequence external reset power-on reset (por) delay (4064 cycles) load program counter with contents of $fffc, $fffd (vector fetch) load program counter with contents of $fffe, $ffff (vector fetch) load program counter with contents of $fffa, $fffb (vector fetch) set s, x, and i bits in ccr. reset mcu hardware x-bit in ccr set? stack cpu registers. set x and i bits. fetch vector at $fff4, $fff5 1a 1b no no yes yes priority highest lowest f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts low power operation mc68hc11p2 ? rev 1.0 technical data resets and interrupts rti ? fetch opcode swi? stack cpu registers. set x and i bits. fetch vector at $fff8, $fff9 1b 1a i-bit in ccr set? i-bit interrupt pending? legal opcode? wai? execute this instruction yes no no yes no no no stack cpu registers. set x and i bits. fetch vector at $fff6, $fff7 restore cpu registers from stack yes yes no stack cpu registers stack cpu registers interrupt yet? set i-bit resolve interrupt priority and fetch vector for highest pending source ( figure 10-3 ) yes yes no start next instruction sequence yes f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts technical data mc68hc11p2 ? rev 1.0 resets and interrupts x-bit in ccr set? highest priority interrupt? rtii = 1? ic1i = 1? ic2i = 1? ic3i = 1? oc1i = 1? begin irq ? 2a xirq pin low? set x-bit in ccr. fetch vector at $fff4, $fff5 fetch vector fetch vector at $fff2, $fff3 fetch vector at $fff0, $fff1 fetch vector at $ffee, $ffef fetch vector at $ffec, $ffed fetch vector at $ffea, $ffeb no yes fetch vector at $ffe8, $ffe9 rtif = 1? ic1f = 1? ic2f = 1? ic3f = 1? oc1f = 1? 2b yes yes yes yes yes yes yes no no no no no no no yes yes yes yes yes no no no no no no yes f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts low power operation mc68hc11p2 ? rev 1.0 technical data resets and interrupts oc2i = 1? oc3i = 1? oc4i = 1? i4/o5i = 1? 2a fetch vector at $ffe6, $ffe7 fetch vector at $ffe4, $ffe5 fetch vector at $ffe2, $ffe3 fetch vector at $ffe0, $ffe1 oc2f = 1? oc3f = 1? oc4f = 1? i4/o5f = 1? 2b yes yes yes yes no no no no yes yes yes yes no no no no sci2 interrupt? ? yes ? refer to figure 10-6 for further details on sci interrupts. fetch vector at $ffd4, $ffd5 sci3 interrupt? ? yes fetch vector at $ffd2, $ffd3 2c 2d toi = 1? fetch vector at $ffde, $ffdf tof = 1? yes no yes no paovi = 1? fetch vector at $ffdc, $ffdd paovf = 1? yes no yes no f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts technical data mc68hc11p2 ? rev 1.0 resets and interrupts figure 10-5. interrupt priority resolution (3 of 3) 2c paii = 1? fetch vector at $ffda, $ffdb paif = 1? 2d yes no yes no sci1 interrupt? ? spie = 1? fetch vector at $ffd8, $ffd9 spif = 1? yes no yes no modf = 1? no no yes yes fetch vector at $fff2, $fff3 spurious interrupt ? take irq vector end ? refer to figure 10-6 for further details on sci interrupts. fetch vector at $ffd6, $ffd7 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts low power operation mc68hc11p2 ? rev 1.0 technical data resets and interrupts figure 10-6. interrupt source resolution within the sci subsystem no begin rdrf = 1? or = 1? tdre = 1? tc = 1? idle = 1? no valid sci interrupt request rie = 1? te = 1? re = 1? tie = 1? tcie = 1? ilie = 1? re = 1? valid sci interrupt request yes yes yes yes yes yes yes yes yes yes yes yes no no no no no no no no no no no note: the bit names shown are for sci1. the diagram applies equally to sci2 and sci3, when the appropriate bit names are substituted. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts technical data mc68hc11p2 ? rev 1.0 resets and interrupts f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc11p2 ? rev 1.0 technical data cpu core and instruction set technical data ? mc68hc11p2 section 11. cpu core and instruction set 11.1 contents 11.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 11.3 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 11.4 data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 11.5 opcodes and operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 11.6 addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 11.7 instruction set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 11.2 introduction this section discusses the m68hc11 central processing unit (cpu) architecture, its addressing modes and the instruction set. for more detailed information on the instruction set, refer to the m68hc11 reference manual (m68hc11rm/ad) . the cpu is designed to treat all peripheral, i/o and memory locations identically, as addresses in the 64kbyte memory map. this is referred to as memory-mapped i/o. there are no special instructions for i/o that are separate from those used for memory. this architecture also allows accessing an operand from an external memory location with no execution-time penalty. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu core and instruction set technical data mc68hc11p2 ? rev 1.0 cpu core and instruction set 11.3 registers m68hc11 cpu registers are an integral part of the cpu and are not addressed as if they were memory locations. the seven registers are shown in figure 11-1 and are discussed in the following paragraphs. 11.3.1 accumulators a, b and d accumulators a and b are general-purpose 8-bit registers that hold operands and results of arithmetic calculations or data manipulations. for some instructions, these two accumulators are treated as a single double-byte (16-bit) accumulator called accumulator d. although most operations can use accumulators a or b interchangeably, the following exceptions apply:  the abx and aby instructions add the contents of 8-bit accumulator b to the contents of 16-bit register x or y, but there are no equivalent instructions that use a instead of b.  the tap and tpa instructions transfer data from accumulator a to the condition code register, or from the condition code register figure 11-1. programming model accumulator a 7 0 accumulator b 70 double accumulator d 15 0 index register x 15 0 index register y 15 0 stack pointer 15 0 program counter 15 0 sc xh i nzv a:b d ix iy sp pc ccr condition code register carry overflow zero negative i interrupt mask half carry (from bit 3) x interrupt mask stop disable f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu core and instruction set registers mc68hc11p2 ? rev 1.0 technical data cpu core and instruction set  the decimal adjust accumulator a (daa) instruction is used after binary-coded decimal (bcd) arithmetic operations, but there is no equivalent bcd instruction to adjust accumulator b.  the add, subtract, and compare instructions associated with both a and b (aba, sba, and cba) only operate in one direction, making it important to plan ahead to ensure the correct operand is in the correct accumulator. 11.3.2 index register x (ix) the ix register provides a 16-bit indexing value that can be added to the 8-bit offset provided in an instruction to create an effective address. the ix register can also be used as a counter or as a temporary storage register. 11.3.3 index register y (iy) the 16-bit iy register performs an indexed mode function similar to that of the ix register. however, most instructions using the iy register require an extra byte of machine code and an extra cycle of execution time because of the way the opcode map is implemented. refer to opcodes and operands for further information. 11.3.4 stack pointer (sp) the m68hc11 cpu has an automatic program stack. this stack can be located anywhere in the address space and can be any size up to the amount of memory available in the system. normally the sp is initialized by one of the first instructions in an application program. the stack is configured as a data structure that grows downward from high memory to low memory. each time a new byte is pushed onto the stack, the sp is decremented. each time a byte is pulled from the stack, the sp is incremented. at any given time, the sp holds the 16-bit address of the next free location in the stack. figure 11-2 is a summary of sp operations. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu core and instruction set technical data mc68hc11p2 ? rev 1.0 cpu core and instruction set $9d = jsr main program jsr, jump to subroutine pc direct dd ff main program next instruction rtn $ad = jsr pc next instruction rtn $18 = pre pc main program $ad = jsr ff next instruction rtn $bd = jsr pc hh ll next instruction rtn main program $8d = bsr pc rr main program next instruction rtn bsr, branch to subroutine $39 = rts pc main program ind, x ind, y extend rtn l sp rtn h sp ? 1 sp ? 2 stack rtn l sp rtn h sp ? 1 sp ? 2 stack rtn l sp+2 rtn h sp+1 sp stack $3b = rti pc sp condition code sp+1 rti, return from interrupt interrupt program stack accumulator b sp+2 accumulator a sp+3 index register (ix h ) sp+4 index register (ix l ) sp+5 index register (iy h ) sp+6 index register (iy l ) sp+7 rtn h sp+8 rtn l sp+9 $3f = swi pc rtn sp ? 9 condition code sp ? 8 main program stack accumulator b sp ? 7 accumulator a sp ? 6 index register (ix h ) sp ? 5 index register (ix l ) sp ? 4 index register (iy h ) sp ? 3 index register (iy l ) sp ? 2 rtn h sp ? 1 swi, software interrupt rtn l sp wai, wait for interrupt $3e = wai pc rtn main program rts, return from subroutine legend rtn address of the next instruction in the main program, to be executed on return from subroutine rtn h more significant byte of return address rtn l less significant byte of return address shaded cells show stack pointer position after the operation is complete dd 8-bit direct address ($0000 ? $00ff); the high byte is assumed to be $00 ff 8-bit positive offset ($00 to $ff (0 to 256)) is added to the index register contents hh high order byte of 16-bit extended address ll low order byte of 16-bit extended address rr signed relative offset ($80 to $7f ( ? 128 to +127)); offset is relative to the address following the offset byte f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu core and instruction set registers mc68hc11p2 ? rev 1.0 technical data cpu core and instruction set when a subroutine is called by a jump to subroutine (jsr) or branch to subroutine (bsr) instruction, the address of the instruction after the jsr or bsr is automatically pushed onto the stack, less significant byte first. when the subroutine is finished, a return from subroutine (rts) instruction is executed. the rts pulls the previously stacked return address from the stack, and loads it into the program counter. execution then continues from this recovered return address. when an interrupt is recognized, the current instruction finishes normally, the return address (the current value in the program counter) is pushed onto the stack, all of the cpu registers are pushed onto the stack, and execution continues at the address specified by the vector for the interrupt. at the end of the interrupt service routine, an rti instruction is executed. the rti instruction causes the saved registers to be pulled off the stack in reverse order. program execution resumes at the return address. there are instructions that push and pull the a and b accumulators and the x and y index registers. these instructions are often used to preserve program context. for example, pushing accumulator a onto the stack when entering a subroutine that uses accumulator a, and then pulling accumulator a off the stack just before leaving the subroutine, ensures that the contents of a register will be the same after returning from the subroutine as they were before starting the subroutine. 11.3.5 program counter (pc) the program counter, a 16-bit register, contains the address of the next instruction to be executed. after reset, the program counter is initialized from one of six possible vectors, depending on operating mode and the cause of reset. table 11-1. reset vector comparison por or reset pin clock monitor cop watchdog normal $fffe, $ffff $fffc, $fffd $fffa, $fffb f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu core and instruction set technical data mc68hc11p2 ? rev 1.0 cpu core and instruction set 11.3.6 condition code register (ccr) this 8-bit register contains five condition code indicators (c, v, z, n, and h), two interrupt masking bits, (irq and xirq) and a stop disable bit (s). in the m68hc11 cpu, condition codes are automatically updated by most instructions. for example, load accumulator a (ldaa) and store accumulator a (staa) instructions automatically set or clear the n, z, and v condition code flags. pushes, pulls, add b to x (abx), add b to y (aby), and transfer/exchange instructions do not affect the condition codes. refer to table 11-2 , which shows the condition codes that are affected by a particular instruction. 11.3.6.1 carry/borrow (c) the c-bit is set if the arithmetic logic unit (alu) performs a carry or borrow during an arithmetic operation. the c-bit also acts as an error flag for multiply and divide operations. shift and rotate instructions operate with and through the carry bit to facilitate multiple-word shift operations. 11.3.6.2 overflow (v) the overflow bit is set if an operation causes an arithmetic overflow. otherwise, the v-bit is cleared. 11.3.6.3 zero (z) the z-bit is set if the result of an arithmetic, logic, or data manipulation operation is zero. otherwise, the z-bit is cleared. compare instructions do an internal implied subtraction and the condition codes, including z, reflect the results of that subtraction. a few operations (inx, dex, iny, and dey) affect the z-bit and no other condition flags. for these operations, only ? = ? and ?|? conditions can be determined. 11.3.6.4 negative (n) the n-bit is set if the result of an arithmetic, logic, or data manipulation f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu core and instruction set registers mc68hc11p2 ? rev 1.0 technical data cpu core and instruction set to test whether the contents of a memory location have the msb set is to load it into an accumulator and then check the status of the n-bit. 11.3.6.5 interrupt mask (i) the interrupt request (irq) mask (i-bit) is a global mask that disables all maskable interrupt sources. while the i-bit is set, interrupts can become pending, but the operation of the cpu continues uninterrupted until the i-bit is cleared. after any reset, the i-bit is set by default and can only be cleared by a software instruction. when an interrupt is recognized, the i-bit is set after the registers are stacked, but before the interrupt vector is fetched. after the interrupt has been serviced, a return from interrupt instruction is normally executed, restoring the registers to the values that were present before the interrupt occurred. normally, the i-bit is zero after a return from interrupt is executed. although the i-bit can be cleared within an interrupt service routine, ? nesting ? interrupts in this way should only be done when there is a clear understanding of latency and of the arbitration mechanism. refer to resets and interrupts . 11.3.6.6 half carry (h) the h-bit is set when a carry occurs between bits 3 and 4 of the arithmetic logic unit during an add, aba, or adc instruction. otherwise, the h-bit is cleared. half carry is used during bcd operations. 11.3.6.7 x interrupt mask (x) the xirq mask (x) bit disables interrupts from the xirq pin. after any reset, x is set by default and must be cleared by a software instruction. when an xirq interrupt is recognized, the x and i bits are set after the registers are stacked, but before the interrupt vector is fetched. after the interrupt has been serviced, an rti instruction is normally executed, causing the registers to be restored to the values that were present before the interrupt occurred. the x interrupt mask bit is set only by hardware (reset or xirq acknowledge). x is cleared only by program instruction (tap, where the associated bit of a is 0; or rti, where bit 6 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu core and instruction set technical data mc68hc11p2 ? rev 1.0 cpu core and instruction set 11.3.6.8 stop disable (s) setting the stop disable (s) bit prevents the stop instruction from putting the m68hc11 into a low-power stop condition. if the stop instruction is encountered by the cpu while the s-bit is set, it is treated as a no-operation (nop) instruction, and processing continues to the next instruction. s is set by reset ? i.e. stop is disabled by default. 11.4 data types the m68hc11 cpu supports the following data types:  bit data  8-bit and 16-bit signed and unsigned integers  16-bit unsigned fractions  16-bit addresses a byte is eight bits wide and can be accessed at any byte location. a word is composed of two consecutive bytes with the most significant byte at the lower value address. because the m68hc11 is an 8-bit cpu, there are no special requirements for alignment of instructions or operands. 11.5 opcodes and operands the m68hc11 family of microcontrollers uses 8-bit opcodes. each opcode identifies a particular instruction and associated addressing mode to the cpu. several opcodes are required to provide each instruction with a range of addressing capabilities. only 256 opcodes would be available if the range of values were restricted to the number able to be expressed in 8-bit binary numbers. a four-page opcode map has been implemented to expand the number of instructions. an additional byte, called a prebyte, directs the processor from page 0 of the opcode map to one of the other three pages. as its f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu core and instruction set addressing modes mc68hc11p2 ? rev 1.0 technical data cpu core and instruction set a complete instruction consists of a prebyte, if any, an opcode, and zero, one, two, or three operands. the operands contain information the cpu needs for executing the instruction. complete instructions can be from one to five bytes long. 11.6 addressing modes six addressing modes (immediate, direct, extended, indexed, inherent and relative) are detailed in the following paragraphs and can be used to access memory. all modes except inherent mode use an effective address. the effective address is the memory address from which the argument is fetched or stored, or the address from which execution is to proceed. the effective address can be specified within an instruction, or it can be calculated. 11.6.1 immediate (imm) in the immediate addressing mode an argument is contained in the byte(s) immediately following the opcode. the number of bytes following the opcode matches the size of the register or memory location being operated on. there are two, three and four (if prebyte is required) byte immediate instructions. the effective address is the address of the byte following the instruction. 11.6.2 direct (dir) in the direct addressing mode, the low-order byte of the operand address is contained in a single byte following the opcode, and the high- order byte of the address is assumed to be $00. addresses $00 ? $ff are thus accessed directly, using two-byte instructions. execution time is reduced by eliminating the additional memory access required for the high-order address byte. in most applications, this 256-byte area is reserved for frequently referenced data. in m68hc11 mcus, the memory map can be configured for combinations of internal registers, ram, or external memory to occupy these addresses. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu core and instruction set technical data mc68hc11p2 ? rev 1.0 cpu core and instruction set 11.6.3 extended (ext) in the extended addressing mode, the effective address of the argument is contained in two bytes following the opcode byte. these are three- byte instructions (or four-byte instructions if a prebyte is required). one or two bytes are needed for the opcode and two for the effective address. 11.6.4 indexed (ind, x; ind, y) in the indexed addressing mode, an 8-bit unsigned offset contained in the instruction is added to the value contained in an index register (ix or iy) ? the sum is the effective address. this addressing mode allows referencing of any memory location in the 64kbyte address space. these are two- to five-byte instructions, depending on whether or not a prebyte is required. 11.6.5 inherent (inh) in the inherent addressing mode, all the information necessary to execute the instruction is contained in the opcode. operations that use only the index registers or accumulators, as well as control instructions with no arguments, are included in this addressing mode. these are one or two-byte instructions. 11.6.6 relative (rel) the relative addressing mode is used only for branch instructions. if the branch condition is true, an 8-bit signed offset included in the instruction is added to the contents of the program counter to form the effective branch address. otherwise, control proceeds to the next instruction. these are usually two-byte instructions. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu core and instruction set instruction set mc68hc11p2 ? rev 1.0 technical data cpu core and instruction set 11.7 instruction set refer to table 11-2 , which shows all the m68hc11 instructions in all possible addressing modes. for each instruction, the table shows the operand construction, the number of machine code bytes, and execution time in cpu e clock cycles. table 11-2. instruction set (sheet 1 of 8) mnemonic operation description addressing mode instruction condition codes opcode operand cycles s x h i n z v c aba add accumulators a + b ? ainh 1b ? 2 ?? ? ? ???? abx add b to x ix + (00:b) ? ix inh 3a ? 3 ???????? aby add b to y iy + (00:b) ? iy inh 18 3a ? 4 ???????? adca (opr) add with carry to a a + m + c ? a a imm adir a ext aind, x aind, y 89 99 b9 a9 18 a9 ii dd hh ll ff ff 2 3 4 4 5 ?? ? ? ???? adcb (opr) add with carry to b b + m + c ? b b imm bdir b ext bind, x bind, y c9 d9 f9 e9 18 e9 ii dd hh ll ff ff 2 3 4 4 5 ?? ? ? ???? adda (opr) add memory to a a + m ? a a imm adir a ext aind, x aind, y 8b 9b bb ab 18 ab ii dd hh ll ff ff 2 3 4 4 5 ?? ? ? ???? addb (opr) add memory to b b + m ? b b imm bdir b ext bind, x bind, y cb db fb eb 18 eb ii dd hh ll ff ff 2 3 4 4 5 ?? ? ? ???? addd (opr) add 16-bit to d d + (m:m+1) ? dimm dir ext ind, x ind, y c3 d3 f3 e3 18 e3 jj kk dd hh ll ff ff 4 5 6 6 7 ???? ???? anda (opr) and a with memory a  m ? aaimm adir a ext aind, x aind, y 84 94 b4 a4 18 a4 ii dd hh ll ff ff 2 3 4 4 5 ???? ?? 0 ? f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu core and instruction set technical data mc68hc11p2 ? rev 1.0 cpu core and instruction set andb (opr) and b with memory b  m ? bbimm bdir b ext bind, x bind, y c4 d4 f4 e4 18 e4 ii dd hh ll ff ff 2 3 4 4 5 ???? ?? 0 ? asl (opr) arithmetic shift left ext ind, x ind, y 78 68 18 68 hh ll ff ff 6 6 7 ???? ???? asla arithmetic shift left a a inh 48 ? 2 ???? ???? aslb arithmetic shift left b b inh 58 ? 2 ???? ???? asld arithmetic shift left d inh 05 ? 3 ???? ???? asr arithmetic shift right ext ind, x ind, y 77 67 18 67 hh ll ff ff 6 6 7 ???? ???? asra arithmetic shift right a a inh 47 ? 2 ???? ???? asrb arithmetic shift right b b inh 57 ? 2 ???? ???? bcc (rel) branch if carry clear c = 0 ? rel 24 rr 3 ???????? bclr (opr) (msk) clear bit(s) m  (mm ) ? m dir ind, x ind, y 15 1d 18 1d dd mm ff mm ff mm 6 7 8 ???? ?? 0 ? bcs (rel) branch if carry set c = 1 ? rel 25 rr 3 ???????? beq (rel) branch if equal to zero z = 1 ? rel 27 rr 3 ???????? bge (rel) branch if ? zero n v = 0 ? rel 2c rr 3 ???????? bgt (rel) branch if > zero z + (n v) = 0 ? rel 2e rr 3 ???????? bhi (rel) branch if higher c + z = 0 ? rel 22 rr 3 ???????? bhs (rel) branch if higher or same c = 0 ? rel 24 rr 3 ???????? bita (opr) bit(s) test a with memory a  m a imm adir a ext aind, x aind, y 85 95 b5 a5 18 a5 ii dd hh ll ff ff 2 3 4 4 5 ???? ?? 0 ? bitb (opr) bit(s) test b with memory b  m b imm bdir b ext bind, x bind, y c5 d5 f5 e5 18 e5 ii dd hh ll ff ff 2 3 4 4 5 ???? ?? 0 ? ble (rel) branch if e zero z + (n v) = 1 ? rel 2f rr 3 ???????? blo (rel) branch if lower c = 1 ? rel 25 rr 3 ???????? bls (rel) branch if lower or same c + z = 1 ? rel 23 rr 3 ???????? blt (rel) branch if < zero n v = 1 ? rel 2d rr 3 ???????? bmi (rel) branch if minus n = 1 ? rel 2b rr 3 ???????? bne (rel) branch if | zero z = 0 ? rel 26 rr 3 ???????? table 11-2. instruction set (sheet 2 of 8) mnemonic operation description addressing mode instruction condition codes opcode operand cycles s x h i n z v c b7 b0 c 0 b15 b0 c 0 b7 b0 c f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu core and instruction set instruction set mc68hc11p2 ? rev 1.0 technical data cpu core and instruction set brclr(opr) (msk) (rel) branch if bit(s) clear m  mm = 0 ? dir ind, x ind, y 13 1f 18 1f dd mm rr ff mm rr ff mm rr 6 7 8 ???????? brn (rel) branch never 1 = 0 ? rel 21 rr 3 ???????? brset(opr) (msk) (rel) branch if bit(s) set m  mm = 0 ? dir ind, x ind, y 12 1e 18 1e dd mm rr ff mm rr ff mm rr 6 7 8 ???????? bset (opr) (msk) set bit(s) m + mm ? m dir ind, x ind, y 14 1c 18 1c dd mm ff mm ff mm 6 7 8 ???? ?? 0 ? bsr (rel) branch to subroutine see figure 11-2 rel 8d rr 6 ???????? bvc (rel) branch if overflow clear v = 0 ? rel 28 rr 3 ???????? bvs (rel) branch if overflow set v = 1 ? rel 29 rr 3 ???????? cba compare a with b a ? binh11 ? 2 ???? ???? clc clear carry bit 0 ? cinh0c ? 2 ??????? 0 cli clear interrupt mask 0 ? iinh0e ? 2 ??? 0 ???? clr (opr) clear memory byte 0 ? m dir ind, x ind, y 7f 6f 18 6f hh ll ff ff 6 6 7 ???? 0100 clra clear accumulator a 0 ? a a inh 4f ? 2 ???? 0100 clrb clear accumulator b 0 ? b b inh 5f ? 2 ???? 0100 clv clear overflow flag 0 ? vinh0a ? 2 ?????? 0 ? cmpa (opr) compare a with memory a ? m a imm adir a ext aind, x aind, y 81 91 b1 a1 18 a1 ii dd hh ll ff ff 2 3 4 4 5 ???? ???? cmpb (opr) compare b with memory b ? m b imm bdir b ext bind, x bind, y c1 d1 f1 e1 18 e1 ii dd hh ll ff ff 2 3 4 4 5 ???? ???? com (opr) ones complement memory byte $ff ? m ? m ext ind, x ind, y 73 63 18 63 hh ll ff ff 6 6 7 ???? ?? 01 coma ones complement a $ff ? a ? a a inh 43 ? 2 ???? ?? 01 comb ones complement b $ff ? b ? b b inh 53 ? 2 ???? ?? 01 cpd (opr) compare d with memory (16-bit) d ? (m:m+1) imm dir ext ind, x ind, y 1a 83 1a 93 1a b3 1a a3 cda3 jj kk dd hh ll ff ff 5 6 7 7 7 ???? ???? table 11-2. instruction set (sheet 3 of 8) mnemonic operation description addressing mode instruction condition codes opcode operand cycles s x h i n z v c f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu core and instruction set technical data mc68hc11p2 ? rev 1.0 cpu core and instruction set cpx (opr) compare ix with memory (16- bit) ix ? (m:m+1) imm dir ext ind, x ind, y 8c 9c bc ac cdac jj kk dd hh ll ff ff 4 5 6 6 7 ???? ???? cpy (opr) compare iy with memory (16- bit) iy ? (m:m+1) imm dir ext ind, x ind, y 18 8c 18 9c 18 bc 1a ac 18 ac jj kk dd hh ll ff ff 5 6 7 7 7 ???? ???? daa decimal adjust a adjust sum to bcd inh 19 ? 2 ???? ?? ? ? dec (opr) decrement memory byte m ? 1 ? m ext ind, x ind, y 7a 6a 18 6a hh ll ff ff 6 6 7 ???? ??? ? deca decrement accumulator a a ? 1 ? a a inh 4a ? 2 ???? ??? ? decb decrement accumulator b b ? 1 ? b b inh 5a ? 2 ???? ??? ? des decrement stack pointer sp ? 1 ? sp inh 34 ? 3 ???????? dex decrement index register x ix ? 1 ? ix inh 09 ? 3 ????? ? ?? dey decrement index register y iy ? 1 ? iy inh 18 09 ? 4 ????? ? ?? eora (opr) exclusive or a with memory a m ? a a imm adir a ext aind, x aind, y 88 98 b8 a8 18 a8 ii dd hh ll ff ff 2 3 4 4 5 ???? ?? 0 ? eorb (opr) exclusive or b with memory b m ? a b imm bdir b ext bind, x bind, y c8 d8 f8 e8 18 e8 ii dd hh ll ff ff 2 3 4 4 5 ???? ?? 0 ? fdiv fractional divide, 16 by 16 d / ix ? ix; r ? dinh 03 ? 41 ????? ??? idiv integer divide, 16 by 16 d / ix ? ix; r ? dinh 02 ? 41 ????? ? 0 ? inc (opr) increment memory byte m + 1 ? m ext ind, x ind, y 7c 6c 18 6c hh ll ff ff 6 6 7 ???? ??? ? inca increment accumulator a a + 1 ? a a inh 4c ? 2 ???? ??? ? incb increment accumulator b b + 1 ? b b inh 5c ? 2 ???? ??? ? ins increment stack pointer sp + 1 ? sp inh 31 ? 3 ???????? inx increment index register x ix + 1 ? ix inh 08 ? 3 ????? ? ?? iny increment index register y iy + 1 ? iy inh 18 08 ? 4 ????? ? ?? jmp (opr) jump see figure 11-2 ext ind, x ind, y 7e 6e 18 6e hh ll ff ff 3 3 4 ???????? jsr (opr) jump to subroutine see figure 11-2 dir 9d dd 5 ???????? table 11-2. instruction set (sheet 4 of 8) mnemonic operation description addressing mode instruction condition codes opcode operand cycles s x h i n z v c f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu core and instruction set instruction set mc68hc11p2 ? rev 1.0 technical data cpu core and instruction set ldaa (opr) load accumulator a m ? a a imm adir a ext aind, x aind, y 86 96 b6 a6 18 a6 ii dd hh ll ff ff 2 3 4 4 5 ???? ?? 0 ? ldab (opr) load accumulator b m ? b b imm bdir b ext bind, x bind, y c6 d6 f6 e6 18 e6 ii dd hh ll ff ff 2 3 4 4 5 ???? ?? 0 ? ldd (opr) load double accumulator d m ? a; m+1 ? bimm dir ext ind, x ind, y cc dc fc ec 18 ec jj kk dd hh ll ff ff 3 4 5 5 6 ???? ?? 0 ? lds (opr) load stack pointer m:m+1 ? sp imm dir ext ind, x ind, y 8e 9e be ae 18 ae jj kk dd hh ll ff ff 3 4 5 5 6 ???? ?? 0 ? ldx (opr) load index register x m:m+1 ? ix imm dir ext ind, x ind, y ce de fe ee cdee jj kk dd hh ll ff ff 3 4 5 5 6 ???? ?? 0 ? ldy (opr) load index register y m:m+1 ? iy imm dir ext ind, x ind, y 18 ce 18 de 18 fe 1a ee 18 ee jj kk dd hh ll ff ff 4 5 6 6 6 ???? ?? 0 ? lsl (opr) logical shift left ext ind, x ind, y 78 68 18 68 hh ll ff ff 6 6 7 ???? ???? lsla logical shift left a a inh 48 ? 2 ???? ???? lslb logical shift left b b inh 58 ? 2 ???? ???? lsld logical shift left d inh 05 ? 3 ???? ???? lsr (opr) logical shift right ext ind, x ind, y 74 64 18 64 hh ll ff ff 6 6 7 ???? 0 ??? lsra logical shift right a a inh 44 ? 2 ???? 0 ??? lsrb logical shift right b b inh 54 ? 2 ???? 0 ??? lsrd logical shift right d inh 04 ? 3 ???? 0 ??? table 11-2. instruction set (sheet 5 of 8) mnemonic operation description addressing mode instruction condition codes opcode operand cycles s x h i n z v c b7 b0 c 0 b15 b0 c 0 b7 b0 0 c b15 b0 0 c f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu core and instruction set technical data mc68hc11p2 ? rev 1.0 cpu core and instruction set neg (opr) twos complement memory byte 0 ? m ? m ext ind, x ind, y 70 60 18 60 hh ll ff ff 6 6 7 ???? ???? nega twos complement a 0 ? a ? a a inh 40 ? 2 ???? ???? negb twos complement b 0 ? b ? b b inh 50 ? 2 ???? ???? nop no operation no operation inh 01 ? 2 ???????? oraa or accumulator a (inclusive) a + m ? a a imm adir a ext aind, x aind, y 8a 9a ba aa 18 aa ii dd hh ll ff ff 2 3 4 4 5 ???? ?? 0 ? orab or accumulator b (inclusive) b + m ? b b imm bdir b ext bind, x bind, y ca da fa ea 18 ea ii dd hh ll ff ff 2 3 4 4 5 ???? ?? 0 ? psha push a onto stack a ? stack; sp = sp ? 1ainh 36 ? 3 ???????? pshb push b onto stack b ? stack; sp = sp ? 1binh 37 ? 3 ???????? pshx push ix onto stack (low first) ix ? stack; sp = sp ? 2inh 3c ? 4 ???????? pshy push iy onto stack (low first) iy ? stack; sp = sp ? 2 inh 18 3c ? 5 ???????? pula pull a from stack sp = sp+1; stack ? aainh 32 ? 4 ???????? pulb pull b from stack sp = sp+1; stack ? bbinh 33 ? 4 ???????? pulx pull ix from stack (high first) sp = sp+2; stack ? ix inh 38 ? 5 ???????? puly pull iy from stack (high first) sp = sp+2; stack ? iy inh 18 38 ? 6 ???????? rol (opr) rotate left ext ind, x ind, y 79 69 18 69 hh ll ff ff 6 6 7 ???? ???? rola rotate left a a inh 49 ? 2 ???? ???? rolb rotate left b b inh 59 ? 2 ???? ???? ror (opr) rotate right ext ind, x ind, y 76 66 18 66 hh ll ff ff 6 6 7 ???? ???? rora rotate right a a inh 46 ? 2 ???? ???? rorb rotate right b b inh 56 ? 2 ???? ???? rti return from interrupt see figure 11-2 inh 3b ? 12 ? ?????? rts return from subroutine see figure 11-2 inh 39 ? 5 ???????? sba subtract b from a a ? b ? ainh 10 ? 2 ???? ???? sbca (opr) subtract with carry from a a ? m ? c ? a a imm adir a ext aind, x aind, y 82 92 b2 a2 18 a2 ii dd hh ll ff ff 2 3 4 4 5 ???? ???? table 11-2. instruction set (sheet 6 of 8) mnemonic operation description addressing mode instruction condition codes opcode operand cycles s x h i n z v c b7 b0 c b7 b0 c f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu core and instruction set instruction set mc68hc11p2 ? rev 1.0 technical data cpu core and instruction set sbcb (opr) subtract with carry from b b ? m ? c ? b b imm bdir b ext bind, x bind, y c2 d2 f2 e2 18 e2 ii dd hh ll ff ff 2 3 4 4 5 ???? ???? sec set carry 1 ? cinh0d ? 2 ??????? 1 sei set interrupt mask 1 ? iinh0f ? 2 ??? 1 ???? sev set overflow flag 1 ? vinh0b ? 2 ?????? 1 ? staa (opr) store accumulator a a ? madir a ext aind, x aind, y 97 b7 a7 18 a7 dd hh ll ff ff 3 4 4 5 ???? ?? 0 ? stab (opr) store accumulator b b ? mbdir b ext bind, x bind, y d7 f7 e7 18 e7 dd hh ll ff ff 3 4 4 5 ???? ?? 0 ? std (opr) store accumulator d a ? m; b ? m+1 dir ext ind, x ind, y dd fd ed 18 ed dd hh ll ff ff 4 5 5 6 ???? ?? 0 ? stop stop internal clocks ? inh cf ? 2 ???????? sts (opr) store stack pointer sp ? m:m+1 dir ext ind, x ind, y 9f bf af 18 af dd hh ll ff ff 4 5 5 6 ???? ?? 0 ? stx (opr) store index register x ix ? m:m+1 dir ext ind, x ind, y df ff ef cdef dd hh ll ff ff 4 5 5 6 ???? ?? 0 ? sty (opr) store index register y iy ? m:m+1 dir ext ind, x ind, y 18 df 18 ff 1a ef 18 ef dd hh ll ff ff 5 6 6 6 ???? ?? 0 ? suba (opr) subtract memory from a a ? m ? a a imm adir a ext aind, x aind, y 80 90 b0 a0 18 a0 ii dd hh ll ff ff 2 3 4 4 5 ???? ???? subb (opr) subtract memory from b b ? m ? b b imm bdir b ext bind, x bind, y c0 d0 f0 e0 18 e0 ii dd hh ll ff ff 2 3 4 4 5 ???? ???? subd (opr) subtract memory from d d ? m:m+1 ? dimm dir 83 93 jj kk dd 4 5 ???? ???? table 11-2. instruction set (sheet 7 of 8) mnemonic operation description addressing mode instruction condition codes opcode operand cycles s x h i n z v c f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
cpu core and instruction set technical data mc68hc11p2 ? rev 1.0 cpu core and instruction set swi software interrupt see figure 11-2 inh 3f ? 14 ??? 1 ???? tab transfer a to b a ? binh16 ? 2 ???? ?? 0 ? tap transfer a to cc register a ? ccr inh 06 ? 2 ? ?????? tba transfer b to a b ? ainh17 ? 2 ???? ?? 0 ? test test (only in test modes) address bus increments inh 00 ? ? ???????? tpa transfer cc register to a ccr ? ainh 07 ? 2 ???????? tst (opr) test for zero or minus m ? 0 ext ind, x ind, y 7d 6d 18 6d hh ll ff ff 6 6 7 ???? ?? 00 tsta test a for zero or minus a ? 0 a inh 4d ? 2 ???? ?? 00 tstb test b for zero or minus b ? 0 b inh 5d ? 2 ???? ?? 00 tsx transfer stack pointer to x sp + 1 ? ix inh 30 ? 3 ???????? tsy transfer stack pointer to y sp + 1 ? iy inh 18 30 ? 4 ???????? txs transfer x to stack pointer ix ? 1 ? sp inh 35 ? 3 ???????? tys transfer y to stack pointer iy ? 1 ? sp inh 18 35 ? 4 ???????? wai wait for interrupt stack registers & wait inh 3e ? ? ???????? xgdx exchange d with x ix ? d; d ? ix inh 8f ? 3 ???????? xgdy exchange d with y iy ? d; d ? iy inh 18 8f ? 4 ???????? operators operands ? is transferred to dd 8-bit direct address ($0000 ? $00ff); the high byte is assumed  boolean and to be zero + arithmetic addition, except where used as an ff 8-bit positive offset ($00 to $ff (0 to 256)) is added to the inclusive-or symbol in boolean formulae contents of the index register exclusive-or hh high order byte of 16-bit extended address * multiply ii one byte of immediate data : concatenation jj high order byte of 16-bit immediate data ? arithmetic subtraction, or negation symbol kk low order byte of 16-bit immediate data (twos complement) ll low order byte of 16-bit extended address mm 8-bit mask (set bits to be affected) rr signed relative offset ($80 to $7f ( ? 128 to +127)); offset is relative to the address following the offset byte cycles condition codes ? infinite, or until reset occurs ? bit not changed ? 12 cycles are used, beginning with the opcode 0 bit always cleared fetch. a wait state is entered, which remains 1 bit always set in effect for an integer number of mpu e clock ? bit set or cleared, depending on the operation cycles (n) until an interrupt is recognized. bit can be cleared, but cannot become set finally, two additional cycles are used to fetch ? not defined the appropriate interrupt vector. (14 + n, total). table 11-2. instruction set (sheet 8 of 8) mnemonic operation description addressing mode instruction condition codes opcode operand cycles s x h i n z v c f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc11p2 ? rev 1.0 technical data electrical specifications technical data ? mc68hc11p2 section 12. electrical specifications 12.1 contents 12.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 12.3 maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 12.4 thermal characteristics and power considerations . . . . . 233 12.5 test methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234 12.6 dc electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . 235 12.7 control timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237 12.2 introduction this section contains the electrical specifications and associated timing information for the standard supply voltage (v dd = 5v 10%) mc68hc11p2 variants. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical specifications technical data mc68hc11p2 ? rev 1.0 electrical specifications 12.3 maximum ratings note: this device contains circuitry designed to protect against damage due to high electrostatic voltages or electric fields. however, it is recommended that normal precautions be taken to avoid the application of any voltages higher than those given in the maximum ratings table to this high impedance circuit. for maximum reliability all unused inputs should be tied to either v ss or v dd . rating symbol value unit supply voltage (1) 1. all voltages are with respect to v ss . v dd ? 0.3 to +7.0 v input voltage (1) v in ? 0.3 to +7.0 v operating temperature range ? mc68hc11p2, mc68hc711p2 t a t l to t h ? 40 to +85 c storage temperature range t stg ? 55 to +150 c current drain per pin (2) ? not vdd, vss, vdd ad, vss ad, vrh or vrl 2. maximum current drain per pin is for one pin at a time, observing maximum power dissipation limits. i d 25 ma f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical specifications thermal characteristics and power considerations mc68hc11p2 ? rev 1.0 technical data electrical specifications 12.4 thermal characteristics and power considerations the average chip junction temperature, t j , in degrees celsius can be obtained from the following equation: [1] where: t a = ambient temperature ( c) ja = package thermal resistance, junction-to-ambient ( c/w) p d = total power dissipation = p int + p i/o (w) p int = internal chip power = i dd  v dd (w) p i/o = power dissipation on input and output pins (user determined) an approximate relationship between p d and t j (if p i/o is neglected) is: [2] solving equations [1] and [2] for k gives: [3] where k is a constant for a particular part. k can be determined by measuring p d (at equilibrium) for a known t a . using this value of k, the values of p d and t j can be obtained for any value of t a , by solving the above equations. the package thermal characteristics are shown below: characteristics symbol value unit thermal resistance ? 84-pin plcc package ? 84-pin cerquad package (eprom) ? 88-pin qfp package ja 50 50 tbd c/w t j t a p d ja ? () + = p d k t j 273 + --------------------- = kp d t a 273 + () ? ja p d 2 ? + = f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical specifications technical data mc68hc11p2 ? rev 1.0 electrical specifications 12.5 test methods ~v dd v dd r2 r1 c te st point pins r1 r2 c pa[7:0], pb[7:0], pc[7:0], pd5, pd0, e, r/w , as 3.26k ? 2.38k ? 90pf pd[4:1] 3.26k ? 2.38k ? 200pf 0.4v v dd ? 0.8v 0.4v nominal nominal ~v ss 70% of v dd 20% of v dd nominal timing ~v dd ~v ss v dd ? 0.8v 0.4v clocks, strobes inputs outputs ~v dd 20% of v dd spec. spec. ~v ss 70% of v dd 20% of v dd spec. timing ~v dd ~v ss clocks, strobes inputs outputs (a) equivalent test loads (b) dc testing (c) ac testing 20% of v dd 70% of v dd v dd ? 0.8v (2) 0.4v (2) 70% of v dd 20% of v dd notes: (1) full test loads are applied during all dc electrical tests and ac timing measurements. (2) during ac timing measurements, inputs are driven to 0.4v and v dd ? 0.8v; timing measurements are taken at the 20% and 70% of v dd points. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical specifications dc electrical characteristics mc68hc11p2 ? rev 1.0 technical data electrical specifications 12.6 dc electrical characteristics (v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = t l to t h , unless otherwise noted) characteristic symbol min. max. unit output voltage (1) ( i load = 10 a ): all outputs except xtal all outputs except xtal, reset & moda 1. v oh specification for reset and moda is not applicable as they are open-drain pins. v oh specification is not applicable to ports c and d in wired-or mode. v ol v oh ? v dd ? 0.1 0.1 ? v v output high voltage (1) ( i load = ? 0.8ma, v dd =4.5v ): all outputs except xtal, reset & moda v oh v dd ? 0.8 ? v output low voltage ( i load = +1.6ma ): all outputs except xtal v ol ? 0.4 v input high voltage: all inputs except reset reset v ih 0.7v dd 0.8v dd v dd + 0.3 v dd + 0.3 v input low voltage ? all inputs v il v ss ? 0.3 0.2v dd v i/o ports tristate leakage ( v in = v ih or v il ): ports a, b, c, d, f, g, h, moda/lir , reset i oz ? 10 a input leakage (2) ( v in = v dd or v ss ): irq , xirq (rom parts) modb/vstby, xirq (eprom parts) 2. refer to a/d specification for the leakage current value for port e. i in ? ? 1 10 a input current with pull-up resistors ( v in = v il ): ports b, f, g, h i ipr 100 500 a ram stand-by voltage (power down) v sb 2.0 v dd v ram stand-by current (power down) i sb ? 10 a input capacitance: port e, irq , xirq , extal ports a, b, c, d, f, g, h, moda/lir , reset c in ? ? 8 12 pf output load capacitance: all outputs except pd[4:1], xtal, moda/lir pd[4:1] c l ? ? 90 200 pf f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical specifications technical data mc68hc11p2 ? rev 1.0 electrical specifications characteristic symbol 2mhz 3mhz 4mhz unit maximum total supply current (including pll) (1) : run: single chip mode run: expanded mode wait: single chip mode (2) wait: expanded mode (2) stop: single chip mode i dd 27 35 10 12 50 32 42 15 17 50 40 50 20 22 50 ma ma ma ma a power dissipation: single chip mode power dissipation: expanded mode p d 149 193 176 231 220 275 mw 1. all current measurements taken with suitable decoupling capacitors across the power supply to suppress the transient switching currents inherent in cmos designs. extal is driven with a square wave, with t cyc = 500/333/250ns for 2/3/4mhz devices. vil 0.2v; vih vdd ? 0.2v; no dc loads wait: all peripheral functions shut down stop: all clocks stopped 2. if the pll low-power wait mode is selected (wen = 1) then, with an external clock of 614khz, the supply current will not exceed 1ma in single chip mode, or 2ma in expanded mode. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical specifications control timing mc68hc11p2 ? rev 1.0 technical data electrical specifications 12.7 control timing (v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = t l to t h ) characteristic (1) 1. all timing is given with respect to 20% and 70% of v dd , unless otherwise noted. symbol 2.0mhz 3.0mhz 4.0mhz unit min. max. min. max. min. max. frequency of operation f op 0 2.0 0 3.0 0 4.0 mhz e clock period t cyc 500 ? 333 ? 250 ? ns crystal frequency f xtal ? 8.0 ? 12.0 ? 16.0 mhz external oscillator frequency 4f op 0 8.0 0 12.0 0 16.0 mhz processor control set-up time (t pcsu = t cyc /4 + 50ns) t pcsu 175 ? 133 ? 112 ? ns reset input pulse width (2) 2. reset is recognized during the first clock cycle it is held low. internal circuitry then drives the pin low for four clock c ycles, releases the pin and samples the pin level two cycles later to determine the source of the interrupt. (see resets and inter- rupts .) pw rstl (3) pw rstl (4) 3. to guarantee an external reset vector. 4. this is the minimum input time; it can be pre-empted by an internal reset. 8 1 ? ? 8 1 ? ? 8 1 ? ? t cyc mode programming set-up time t mps 2 ? 2 ? 2 ? t cyc mode programming hold time t mph 10 ? 10 ? 10 ? ns interrupt pulse width (irq edge sensitive mode) pw irq t cyc +20 ? t cyc +20 ? t cyc +20 ? ns timer pulse width (input capture and pulse accumulator inputs) pw tim t cyc +20 ? t cyc +20 ? t cyc +20 ? ns wait recovery start-up time t wrs ? 4 ? 4 ? 4 t cyc clock monitor reset f cmon 10 200 10 200 10 200 khz pll crystal frequency f xtal ? 2.0 ? 2.0 ? 2.0 mhz pll stabilization time t plls ? tbd ? tbd ? tbd ms pw tim notes pa[3:0] (2) pa[3:0] (1) pa7 (1), (3) pa7 (2), (3) (1) rising edge sensitive input. (2) falling edge sensitive input. (3) maximum pulse accumulator clocking rate is e clock frequency divided by two (e/2). f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical specifications technical data mc68hc11p2 ? rev 1.0 electrical specifications figure 12-3. reset timing ffff fffe fffe fffe fffe fffe new ffff fffe fffe fffe fffe pc new pc v dd extal e reset moda, address modb 4064 t cyc t pcsu pw rstl t mps t mph va+1 va sp ? 8 sp ? 5 e clock address (3) oa notes: sp ? 3 sp ? 8 sp oa+1 r/w t pcsu sp ? 7 sp ? 4 sp ? 2 sp ? 1 new pc sp ? 6 pw irq ? ? pcl pch iyl iyh op ixl ixh b a ccr ? ? vh vl op data (4) irq (1) irq (2) , xirq or internal interrupt (1) edge sensitive irq pin (irqe = 1). (2) level sensitive irq pin (irqe = 0). (3) where oa = opcode address and va = vector address. (4) where op = opcode, vh = vector (msb) and vl = vector (lsb). f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical specifications control timing mc68hc11p2 ? rev 1.0 technical data electrical specifications figure 12-5. stop recovery timing fff3 fff2 sp ? 8 sp ? 8 sp ? 7 sp ? sa+2 new pc internal irq (1) e clock address (5) clocks sa+1 sa (6) sa+1 sa+1 sa (6) sa+1 op- code address (4) pw irq t stopdelay (3) irq (2) or xirq resume program with instruction which follows the stop instruction notes: (1) edge sensitive irq pin (irqe = 1). (2) level sensitive irq pin (irqe = 0). (3) t stopdelay = 4064 t cyc (dly = 1) or 4 t cyc (dly = 0). (4) xirq with x-bit in ccr = 1. (5) irq (or xirq , with x-bit = 0; in this case vector fetch will be $fff4/5). (6) sa = stop address. va+1 va (2) sp ? 8 sp ? 8 e clock address wa (1) wa+1 notes: reset also causes recovery from wait. (1) wa = wait address. (2) va = vector address. sp ? 8 sp ? 8 ? sp ? 8 sp ? 8 sp ? 2 ? sp ? 8 sp ? 1 sp new pc irq , xirq , or internal interrupts r/w t pcsu t wrs stack registers f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical specifications technical data mc68hc11p2 ? rev 1.0 electrical specifications 12.7.1 peripheral port timing (v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = t l to t h ) characteristic (1) 1. all timing is given with respect to 20% and 70% of v dd , unless otherwise noted. symbol 2.0mhz 3.0mhz 4.0mhz unit min. max. min. max. min. max. frequency of operation (e clock frequency) f op 02.003.004.0mhz e clock period t cyc 500 ? 333 ? 250 ? ns peripheral data set-up time, all ports (2) 2. port c and d timing is valid for active drive (cwom and dwom bits clear in opt2 and spcr registers, respectively). t pdsu 100 ? 100 ? 100 ? ns peripheral data hold time, all ports (2) t pdh 50 ? 50 ? 50 ? ns delay time, peripheral data write mcu write to port a, b, g or h mcu write to port c, d or f t pwd ? ? 200 225 ? ? 200 183 ? ? 200 162 ns figure 12-7. port read timing diagram figure 12-8. port write timing diagram mcu read of port e clock ports a, c, d, f ports t pdsu t pdh t pdsu t pdh b, e, g, h t pwd mcu write to port t pwd previous port data new data valid previous port data new data valid e clock ports c, d, f ports a, b, g, h f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical specifications control timing mc68hc11p2 ? rev 1.0 technical data electrical specifications 12.7.2 analog-to-digital converter characteristics (v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = t l to t h , 750khz e 4mhz, unless otherwise noted) characteristic parameter min. absolute 2mhz (1) 3mhz (1) 4mhz (1) unit max. max. max. resolution number of bits resolved by adc ? 8 ??? bits non-linearity maximum deviation from the ideal adc transfer characteristics ?? 0.5 1 1 lsb zero error difference from the output of an ideal adc for zero input voltage ?? 0.5 1 1 lsb full-scale error difference from the output of an ideal adc for full-scale input voltage ?? 0.5 1 1 lsb to t a l unadjusted error maximum sum of non-linearity, zero and full- scale errors ?? 0.5 1.5 1.5 lsb quantization error uncertainty due to converter resolution ?? 0.5 0.5 0.5 lsb absolute accuracy difference between the actual input voltage and the full-scale weighted equivalent of the binary output code, including all error sources ?? 1 2 2 lsb conversion range analog input voltage range v rl ? v rh v rh v rh v v rh analog reference voltage (high) (2) v rl ? v dd +0.1 v dd +0.1 v dd +0.1 v v rl analog reference voltage (low) (2) v ss ? 0.1 ? v rh v rh v rh v ? v r minimum difference between v rh and v rl (2) 3 ???? v conversion time total time to perform a single a/d conversion: e clock internal rc oscillator ? ? 32 ? ? t cyc +32 ? t cyc +32 ? t cyc +32 t cyc s monotonicity conversion result never decreases with an increase in input voltage and has no missing codes guaranteed zero input reading conversion result when v in = v rl $00 ???? hex full-scale reading conversion result when v in = v rh ?? $ff $ff $ff hex sample acquisition time analogue input acquisition sampling time: e clock internal rc oscillator ? ? 12 ? ? 12 ? 12 ? 12 t cyc s sample/hold capacitance input capacitance (pe[0:7]) during sample ? 20 (typ) ??? pf input leakage input leakage on a/d pins: pe[0:7] v rl , v rh ? ? ? ? 400 1.0 400 1.0 400 1.0 na a f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical specifications technical data mc68hc11p2 ? rev 1.0 electrical specifications 12.7.3 serial peripheral interface timing (v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = t l to t h ) num characteristic (1) 1. all timing is given with respect to 20% and 70% of v dd , unless otherwise noted. symbol 2.0mhz 3.0mhz 4.0mhz unit min. max. min. max. min. max. operating frequencymaster slave f op(m) f op(s) 0 0 0.5 2.0 0 0 0.5 3.0 0 0 0.5 4.0 f op mhz 1 cycle timemaster slave t cyc(m) t cyc(s) 2.0 500 ? ? 2.0 333 ? ? 2.0 250 ? ? t cyc ns 2 enable lead time (2) master slave 2. signal production depends on software. t lead(m) t lead(s) ? 250 ? ? ? 240 ? ? ? 200 ? ? ns 3 enable lag time (2) master slave t lag(m) t lag(s) ? 250 ? ? ? 240 ? ? ? 200 ? ? ns 4 clock (sck) high timemaster slave t w(sckh) m t w(sckh)s 340 190 ? ? 227 127 ? ? 130 85 ? ? ns 5 clock (sck) low timemaster slave t w(sckl)m t w(sckl)s 340 190 ? ? 227 127 ? ? 130 85 ? ? ns 6 input data set-up timemaster slave t su(m) t su(s) 100 100 ? ? 100 100 ? ? 100 100 ? ? ns 7 input data hold timemaster slave t h(m) t h(s) 100 100 ? ? 100 100 ? ? 100 100 ? ? ns 8 access time (from high-z to data active) slave t a 012001200120ns 9 disable time (hold time to high-z state)slave t dis ? 240 ? 167 ? 125 ns 10 data valid (after enable edge) (3) 3. assumes 200pf load on all spi pins. t v(s) ? 240 ? 167 ? 125 ns 11 output data hold time (after enable edge) t ho 0 ? 0 ? 0 ? ns 12 rise time (3) spi outputs (sck, mosi and miso) spi inputs (sck, mosi, miso and ss ) t rm t rs ? ? 100 2.0 ? ? 100 2.0 ? ? 100 2.0 ns s 13 fall time (3) spi outputs (sck, mosi and miso) spi inputs (sck, mosi, miso and ss ) t fm t fs ? ? 100 2.0 ? ? 100 2.0 ? ? 100 2.0 ns s f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical specifications control timing mc68hc11p2 ? rev 1.0 technical data electrical specifications figure 12-9. spi master timing (cpha = 0) figure 12-10. spi master timing (cpha = 1) 1 ss (input) sck (cpol=0) (output) sck (cpol=1) (output) miso (input) mosi (output) (see note) (see note) ss is held high on master msb in lsb in bit 6 ?? 1 master msb out bit 6 ?? 1 master lsb out 13 12 13 5 4 4 5 7 11 10 12 13 6 10 (ref.) 11 (ref.) 12 note: this first clock edge is generated internally, but is not seen at the sck pin. 1 ss (input) sck (cpol=0) (output) sck (cpol=1) (output) miso (input) mosi (output) (see note) ss is held high on master msb in lsb in bit 6 ?? 1 master msb out bit 6 ?? 1 master lsb out 12 13 12 5 4 4 5 11 10 12 13 10 (ref.) 11 (ref.) 13 note: this last clock edge is generated internally, but is not seen at the sck pin. (see note) 7 6 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical specifications technical data mc68hc11p2 ? rev 1.0 electrical specifications figure 12-11. spi slave timing (cpha = 0) figure 12-12. spi slave timing (cpha = 1) 1 ss (input) sck (cpol=0) (input) sck (cpol=1) (input) mosi (input) miso (output) msb in lsb in bit 6 ?? 1 slave msb out bit 6 ?? 1 slave lsb out 12 13 12 5 4 4 5 8 11 13 note: not defined, but normally the msb of character just received. 7 6 10 (see note) 9 3 2 1 ss (input) s ck (cpol=0) (input) s ck (cpol=1) (input) mosi (input) miso (output) msb in lsb in bit 6 ?? 1 slave msb out bit 6 ?? 1 slave lsb out 12 13 12 5 4 4 5 8 11 13 note: not defined, but normally the lsb of character last transmitted. 7 6 10 (see note) 9 3 2 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical specifications control timing mc68hc11p2 ? rev 1.0 technical data electrical specifications 12.7.4 nonmultiplexed expansion bus timing (v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = t l to t h ) num characteristic (1) 1. all timing is given with respect to 20% and 70% of v dd , unless otherwise noted. symbol 2.0mhz 3.0mhz 4.0mhz unit min. max. min. max. min. max. frequency of operation (e clock frequency) f op 0 2.0 0 3.0 0 4.0 mhz 1 e clock period t cyc 500 ? 333 ? 250 ? ns 2 pulse width, e low (2), (3) 2. input clock duty cycles other than 50% will affect the bus performance. 3. for f op 2mhz the following formulae may be used to calculate parameter values: pw el = t cyc /2 ? 20ns pw eh = t cyc /2 ? 25ns t ah = t cyc /8 ? 10ns t ad = t cyc /8 + 40ns t av = pw el ? t ad t dhw = t cyc /8 t acca = t cyc ? t f ? t dsr ? t ad t dsw = pw eh ? t ddw t ecsa = pw eh ? t ecsd ? t dsr t acsd = t cyc /4 + 40ns t acsa = t cyc ? t f ? t dsr ? t acsd pw el 230 ? 147 ? 105 ? ns 3 pulse width, e high (2), (3) pw eh 225 ? 142 ? 100 ? ns 4a 4b e clockrise time fall time t r t f ? ? 20 20 ? ? 20 18 ? ? 20 15 ns 9 address hold time (3) t ah 53 ? 32 ? 21 ? ns 11 address delay time (3) t ad ? 103 ? 82 ? 71 ns 12 address valid to e rise time (3) t av 127 ? 65 ? 34 ? ns 17 read data set-up time t dsr 30 ? 30 ? 20 ? ns 18 read data hold time t dhr 0 ? 0 ? 0 ? ns 19 write data delay time t ddw ? 40 ? 40 ? 40 ns 21 write data hold time (3) t dhw 63 ? 42 ? 31 ? ns 29 mpu address access time (3) t acca 347 ? 203 ? 144 ? ns 39 write data set-up time (3) t dsw 185 ? 102 ? 60 ? ns 57 address valid to data tristate time t avdz ? 10 ? 10 ? 10 ns f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical specifications technical data mc68hc11p2 ? rev 1.0 electrical specifications 12.7.5 eeprom characteristics 12.7.6 eprom characteristics figure 12-13. expansion bus timing characteristic temperature range unit ? 40 to +85 c ? 40 to +105 c ? 40 to +125 c programming time (1) <1mhz, rco enabled 1 ? 2mhz, rco disabled 2mhz & whenever rco enabled 1. the rc oscillator (rco) must be enabled (by setting the csel bit in the option register) for eeprom programming and erasure when the e clock frequency is less than 1.0mhz. 10 20 10 15 must use rco 15 20 must use rco 20 ms erase time: byte, row and bulk (1) 10 10 10 ms write/erase endurance (2) 2. refer to the current issue of motorola ? s quarterly reliability monitor report for the latest failure rate information. 10000 10000 10000 cycles data retention (2) 10 10 10 years (v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = t l to t h , unless otherwise noted) characteristic symbol min . typ . max . unit programming voltage v ppe 11.75 12.25 12.75 v programming time t eprog 2 24 ms e clock r/w , address data (read) data (write) 1 2 3 4b 4a 12 11 9 18 21 39 17 29 57 19 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc11p2 ? rev 1.0 technical data mechanical data technical data ? mc68hc11p2 section 13. mechanical data 13.1 contents 13.2 pin assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 13.3 package dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mechanical data technical data mc68hc11p2 ? rev 1.0 mechanical data 13.2 pin assignments the mc68hc11p2 is available in 84-pin plcc or 88-pin qfp packages; in addition to those two packages, the mc68hc711p2 is also available in a windowed 84-pin cerquad package, to allow full use of the eprom . figure 13-1. 84-pin plcc/cerquad pinout pb0/a8 pb1/a9 pb2/a10 pb3/a11 pb4/a12 pb5/a13 pb6/a14 pb7/a15 vss vdd pa0/ic3 pa1/ic2 pa2/ic1 pa3/oc1/oc5/ic4 pa4/oc1/oc4 pa5/oc1/oc3 pa6/oc1/oc2 pa7/oc1/pai pd5/ss pd4/sck pd3/mosi pg0 vdd ad ad7/pe7 ad6/pe6 ad5/pe5 ad4/pe4 ad3/pe3 ad2/pe2 ad1/pe1 ad0/pe0 vrl vrh vss ad a7/pf7 a6/pf6 a5/pf5 a4/pf4 a3/pf3 a2/pf2 a1/pf1 a0/pf0 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 11 10 9 8 7 6 5 4 3 2 84 83 82 81 80 79 78 77 76 75 pd2/miso pd1/txd1 pd0/rxd1 moda/lir reset xfc vddsyn extal xtal e vddr vssr pc7/d7 pc6/d6 pc5/d5 pc4/d4 pc3/d3 pc2/d2 pc1/d1 pc0/d0 irq pw1/ph0 pw2/ph1 pw3/ph2 pw4/ph3 rxd2/ph4 txd2/ph5 rxd3/ph6 txd3/ph7 modb/vstby xirq vdd vddl vssl vss r/w /pg7 pg6 pg5 pg4 pg3 pg2 pg1 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mechanical data package dimensions mc68hc11p2 ? rev 1.0 technical data mechanical data 13.3 package dimensions ? l ? ? m ? ? p ? ? n ? pin 1 pin 84 v w y brk z r a c j e g g1 u b g1 z1 x 0.10 ? t ? seating plane case no. 780-01 84 lead plcc dim. min. max. notes dim. min. max. a 30.10 30.35 1. due to space limitations, this case shall be represented by a general case outline, rather than one showing all the leads. 2. datums ? l ? , ? m ? , ? n ? and ? p ? are determined where top of lead shoulder exits plastic body at mould parting line. 3. dimension g1, true position to be measured at datum ? t ? (seating plane). 4. dimensions r and u do not include mould protrusion. allowable mould protrusion is 0.25mm per side. 5. dimensions and tolerancing per ansi y 14.5m, 1982. 6. all dimensions in mm. u 29.21 29.36 b 30.10 30.35 v 1.07 1.21 c 4.20 4.57 w 1.07 1.21 e 2.29 2.79 x 1.07 1.42 f 0.33 0.48 y ? 0.50 g 1.27 bsc z 2 10 h 0.66 0.81 g1 28.20 28.70 j0.51 ? k1 1.02 ? k0.64 ? z1 2 10 r 29.21 29.36 (note 1) h k1 k f 0.18 t n ? pl ? m ms ss s 0.18 t l ? mn ? p ms ss s 0.18 t l ? mn ? p ms ss s 0.18 t n ? pl ? m ms ss s 0.25 t l ? mn ? p ss ss s 0.18 t n ? pl ? m ms ss s 0.18 t l ? mn ? p ms ss s 0.18 t n ? pl ? m ms ss s 0.18 t l ? mn ? p ms ss s f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mechanical data technical data mc68hc11p2 ? rev 1.0 mechanical data ? l ? ? m ? ? p ? ? n ? pin 1 pin 84 v w y brk z r a c j e g g1 u b g1 z1 x 0.10 ? t ? seating plane case no. 780a-01 84 lead cerquad dim. min. max. notes dim. min. max. a 30.10 30.35 1. due to space limitations, this case shall be represented by a general case outline, rather than one showing all the leads. 2. datums ? l ? , ? m ? , ? n ? and ? p ? are determined where top of lead shoulder exits package body at glass parting line. 3. dimension g1, true position to be measured at datum ? t ? (seating plane). 4. dimensions r and u do not include glass protrusion. allowable glass protrusion is 0.25mm per side. 5. dimensions and tolerancing per ansi y 14.5m, 1982. 6. all dimensions in mm. u 29.21 29.36 b 30.10 30.35 v 1.07 1.21 c 4.20 4.57 w 1.07 1.21 e 2.29 2.79 x 1.07 1.42 f 0.33 0.53 y ? 0.50 g 1.27 bsc z 2 10 h 0.66 0.81 g1 28.20 28.70 j0.51 ? k1 1.02 ? k0.64 ? z1 2 10 r 29.21 29.36 (note 1) h k1 k f 0.18 t n ? pl ? m ms ss s 0.18 t l ? mn ? p ms ss s 0.18 t l ? mn ? p ms ss s 0.18 t n ? pl ? m ms ss s 0.25 t l ? mn ? p ss ss s 0.18 t n ? pl ? m ms ss s 0.18 t l ? mn ? p ms ss s 0.18 t n ? pl ? m ms ss s 0.18 t l ? mn ? p ms ss s f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc11p2 ? rev 1.0 technical data ordering information technical data ? mc68hc11p2 section 14. ordering information 14.1 contents 14.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 14.2 introduction use the information in table 14-1 to specify the appropriate device type when placing an order. table 14-1. ordering information package temperature config register description frequency mc order number 84-pin plcc ? 40 to +85 c $ff buffalo rom 4mhz mc68hc11p2bcfn4 $xx custom rom 3mhz 4mhz mc68hc11p2cfn3 mc68hc11p2cfn4 $xx custom rom, no eeprom 3mhz 4mhz mc68hc11p3cfn3 mc68hc11p3cfn4 $fd no rom 3mhz 4mhz mc68hc11p1cfn3 mc68hc11p1cfn4 $fc no rom or eeprom 3mhz 4mhz MC68HC11P0CFN3 mc68hc11p0cfn4 $ff otprom 3mhz 4mhz mc68hc711p2cfn3 mc68hc711p2cfn4 84-pin cerquad ? 40 to +85 c$ff eprom 3mhz 4mhz mc68hc711p2cfs3 mc68hc711p2cfs4 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
ordering information technical data mc68hc11p2 ? rev 1.0 ordering information f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc11p2 ? rev 1.0 technical data development support technical data ? mc68hc11p2 section 15. development support 15.1 contents 15.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 15.3 evs ? evaluation system . . . . . . . . . . . . . . . . . . . . . . . . . . 253 15.2 introduction the following information provides a reference to development tools for the m68hc11 family of microcontrollers. for more detailed information please refer to the appropriate system manual. 15.3 evs ? evaluation system the evs is an economical tool for designing, debugging and evaluating target systems based on the mc68hc11p2 and mc68hc711p2 device types. the two printed circuit boards that comprise the evs are the mc68hc11kmnpem emulator module and the mc68hc11pfb platform board. the main features of the evs are as follows:  monitor/debugger firmware  single-line assembler/disassembler table 15-1. m68hc11 development tools devices evaluation boards evaluation modules evaluation systems/kits programmer boards mc68hc11p2, mc68hc711p2 ?? mc68hc11kmnpevs ? f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
development support technical data mc68hc11p2 ? rev 1.0 development support  dual memory maps: ? 64k byte monitor map that includes 16k bytes of monitor eprom ? mc68hc711p2 user map that includes 64k bytes of emulation ram  mcu extension i/o port for single chip, expanded and special test operating modes  rs-232c terminal and host i/o ports  logic analyser connector f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc11p2 ? rev 1.0 technical data glossary technical data ? mc68hc11p2 glossary a ? see ? accumulator (a). ? accumulator (a) ? an 8-bit general-purpose register in the cpu08. the cpu08 uses the accumulator to hold operands and results of arithmetic and logic operations. acquisition mode ? a mode of pll operation during startup before the pll locks on a frequency. also see "tracking mode." address bus ? the set of wires that the cpu or dma uses to read and write memory locations. addressing mode ? the way that the cpu determines the operand address for an instruction. the m68hc08 cpu has 16 addressing modes. alu ? see ? arithmetic logic unit (alu). ? arithmetic logic unit (alu) ? the portion of the cpu that contains the logic circuitry to perform arithmetic, logic, and manipulation operations on operands. asynchronous ? refers to logic circuits and operations that are not synchronized by a common reference signal. baud rate ? the total number of bits transmitted per unit of time. bcd ? see ? binary-coded decimal (bcd). ? binary ? relating to the base 2 number system. binary number system ? the base 2 number system, having two digits, 0 and 1. binary arithmetic is convenient in digital circuit design because digital circuits have two permissible voltage levels, low and high. the binary digits 0 and 1 can be interpreted to correspond to the two digital voltage levels. binary-coded decimal (bcd) ? a notation that uses 4-bit binary numbers to represent the 10 decimal digits and that retains the same positional structure of a decimal number. for example, 234 (decimal) = 0010 0011 0100 (bcd) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
glossary technical data mc68hc11p2 ? rev 1.0 glossary branch instruction ? an instruction that causes the cpu to continue processing at a memory location other than the next sequential address. break module ? a module in the m68hc08 family. the break module allows software to halt program execution at a programmable point in order to enter a background routine. breakpoint ? a number written into the break address registers of the break module. when a number appears on the internal address bus that is the same as the number in the break address registers, the cpu executes the software interrupt instruction (swi). break interrupt ? a software interrupt caused by the appearance on the internal address bus of the same value that is written in the break address registers. bus ? a set of wires that transfers logic signals. bus clock ? the bus clock is derived from the cgmout output from the cgm. the bus clock frequency, f op , is equal to the frequency of the oscillator output, cgmxclk, divided by four. byte ? a set of eight bits. c ? the carry/borrow bit in the condition code register. the cpu08 sets the carry/borrow bit when an addition operation produces a carry out of bit 7 of the accumulator or when a subtraction operation requires a borrow. some logical operations and data manipulation instructions also clear or set the carry/borrow bit (as in bit test and branch instructions and shifts and rotates). ccr ? see ? condition code register. ? central processor unit (cpu) ? the primary functioning unit of any computer system. the cpu controls the execution of instructions. cgm ? see ? clock generator module (cgm). ? clear ? to change a bit from logic 1 to logic 0; the opposite of set. clock ? a square wave signal used to synchronize events in a computer. clock generator module (cgm) ? a module in the m68hc08 family. the cgm generates a base clock signal from which the system clocks are derived. the cgm may include a crystal oscillator circuit and or phase-locked loop (pll) circuit. comparator ? a device that compares the magnitude of two inputs. a digital comparator defines the equality or relative differences between two binary numbers. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
glossary mc68hc11p2 ? rev 1.0 technical data glossary condition code register (ccr) ? an 8-bit register in the cpu08 that contains the interrupt mask bit and five bits that indicate the results of the instruction just executed. control bit ? one bit of a register manipulated by software to control the operation of the module. control unit ? one of two major units of the cpu. the control unit contains logic functions that synchronize the machine and direct various operations. the control unit decodes instructions and generates the internal control signals that perform the requested operations. the outputs of the control unit drive the execution unit, which contains the arithmetic logic unit (alu), cpu registers, and bus interface. cop ? see "computer operating properly module (cop)." counter clock ? the input clock to the tim counter. this clock is the output of the tim prescaler. cpu ? see ? central processor unit (cpu). ? cpu08 ? the central processor unit of the m68hc08 family. cpu clock ? the cpu clock is derived from the cgmout output from the cgm. the cpu clock frequency is equal to the frequency of the oscillator output, cgmxclk, divided by four. cpu cycles ? a cpu cycle is one period of the internal bus clock, normally derived by dividing a crystal oscillator source by two or more so the high and low times will be equal. the length of time required to execute an instruction is measured in cpu clock cycles. cpu registers ? memory locations that are wired directly into the cpu logic instead of being part of the addressable memory map. the cpu always has direct access to the information in these registers. the cpu registers in an m68hc08 are:  a (8-bit accumulator)  h:x (16-bit index register)  sp (16-bit stack pointer)  pc (16-bit program counter)  ccr (condition code register containing the v, h, i, n, z, and c bits) csic ? customer-specified integrated circuit cycle time ? the period of the operating frequency: t =1/f . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
glossary technical data mc68hc11p2 ? rev 1.0 glossary direct memory access module (dma) ? a m68hc08 family module that can perform data transfers between any two cpu-addressable locations without cpu intervention. for transmitting or receiving blocks of data to or from peripherals, dma transfers are faster and more code-efficient than cpu interrupts. dma ? see "direct memory access module (dma)." dma service request ? a signal from a peripheral to the dma module that enables the dma module to transfer data. duty cycle ? a ratio of the amount of time the signal is on versus the time it is off. duty cycle is usually represented by a percentage. eeprom ? electrically erasable, programmable, read-only memory. a nonvolatile type of memory that can be electrically reprogrammed. eprom ? erasable, programmable, read-only memory. a nonvolatile type of memory that can be erased by exposure to an ultraviolet light source and then reprogrammed. exception ? an event such as an interrupt or a reset that stops the sequential execution of the instructions in the main program. external interrupt module (irq) ? a module in the m68hc08 family with both dedicated external interrupt pins and port pins that can be enabled as interrupt pins. fetch ? to copy data from a memory location into the accumulator. firmware ? instructions and data programmed into nonvolatile memory. free-running counter ? a device that counts from zero to a predetermined number, then rolls over to zero and begins counting again. full-duplex transmission ? communication on a channel in which data can be sent and received simultaneously. h ? the upper byte of the 16-bit index register (h:x) in the cpu08. h ? the half-carry bit in the condition code register of the cpu08. this bit indicates a carry from the low-order four bits of the accumulator value to the high-order four bits. the half-carry bit is required for binary-coded decimal arithmetic operations. the decimal adjust accumulator (daa) instruction uses the state of the h and c bits to determine the appropriate correction factor. hexadecimal ? base 16 numbering system that uses the digits 0 through 9 and the letters a through f. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
glossary mc68hc11p2 ? rev 1.0 technical data glossary illegal address ? an address not within the memory map illegal opcode ? a nonexistent opcode. i ? the interrupt mask bit in the condition code register of the cpu08. when i is set, all interrupts are disabled. index register (h:x) ? a 16-bit register in the cpu08. the upper byte of h:x is called h. the lower byte is called x. in the indexed addressing modes, the cpu uses the contents of h:x to determine the effective address of the operand. h:x can also serve as a temporary data storage location. input/output (i/o) ? input/output interfaces between a computer system and the external world. a cpu reads an input to sense the level of an external signal and writes to an output to change the level on an external signal. instructions ? operations that a cpu can perform. instructions are expressed by programmers as assembly language mnemonics. a cpu interprets an opcode and its associated operand(s) and instruction. interrupt ? a temporary break in the sequential execution of a program to respond to signals from peripheral devices by executing a subroutine. interrupt request ? a signal from a peripheral to the cpu intended to cause the cpu to execute a subroutine. i/o ? see ? input/output (i/0). ? irq ? see "external interrupt module (irq)." jitter ? short-term signal instability. latch ? a circuit that retains the voltage level (logic 1 or logic 0) written to it for as long as power is applied to the circuit. latency ? the time lag between instruction completion and data movement. least significant bit (lsb) ? the rightmost digit of a binary number. logic 1 ? a voltage level approximately equal to the input power voltage (v dd ). logic 0 ? a voltage level approximately equal to the ground voltage (v ss ). low byte ? the least significant eight bits of a word. low voltage inhibit module (lvi) ? a module in the m68hc08 family that monitors power f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
glossary technical data mc68hc11p2 ? rev 1.0 glossary lvi ? see "low voltage inhibit module (lvi)." m68hc08 ? a motorola family of 8-bit mcus. mark/space ? the logic 1/logic 0 convention used in formatting data in serial communication. mask ? 1. a logic circuit that forces a bit or group of bits to a desired state. 2. a photomask used in integrated circuit fabrication to transfer an image onto silicon. mask option ? a optional microcontroller feature that the customer chooses to enable or disable. mask option register (mor) ? an eprom location containing bits that enable or disable certain mcu features. mcu ? microcontroller unit. see ? microcontroller. ? memory location ? each m68hc08 memory location holds one byte of data and has a unique address. to store information in a memory location, the cpu places the address of the location on the address bus, the data information on the data bus, and asserts the write signal. to read information from a memory location, the cpu places the address of the location on the address bus and asserts the read signal. in response to the read signal, the selected memory location places its data onto the data bus. memory map ? a pictorial representation of all memory locations in a computer system. microcontroller ? microcontroller unit (mcu). a complete computer system, including a cpu, memory, a clock oscillator, and input/output (i/o) on a single integrated circuit. modulo counter ? a counter that can be programmed to count to any number from zero to its maximum possible modulus. monitor rom ? a section of rom that can execute commands from a host computer for testing purposes. mor ? see "mask option register (mor)." most significant bit (msb) ? the leftmost digit of a binary number. multiplexer ? a device that can select one of a number of inputs and pass the logic level of that input on to the output. n ? the negative bit in the condition code register of the cpu08. the cpu sets the negative bit when an arithmetic operation, logical operation, or data manipulation produces a negative result. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
glossary mc68hc11p2 ? rev 1.0 technical data glossary object code ? the output from an assembler or compiler that is itself executable machine code, or is suitable for processing to produce executable machine code. opcode ? a binary code that instructs the cpu to perform an operation. open-drain ? an output that has no pullup transistor. an external pullup device can be connected to the power supply to provide the logic 1 output voltage. operand ? data on which an operation is performed. usually a statement consists of an operator and an operand. for example, the operator may be an add instruction, and the operand may be the quantity to be added. oscillator ? a circuit that produces a constant frequency square wave that is used by the computer as a timing and sequencing reference. otprom ? one-time programmable read-only memory. a nonvolatile type of memory that cannot be reprogrammed. overflow ? a quantity that is too large to be contained in one byte or one word. page zero ? the first 256 bytes of memory (addresses $0000 ? $00ff). parity ? an error-checking scheme that counts the number of logic 1s in each byte transmitted. in a system that uses odd parity, every byte is expected to have an odd number of logic 1s. in an even parity system, every byte should have an even number of logic 1s. in the transmitter, a parity generator appends an extra bit to each byte to make the number of logic 1s odd for odd parity or even for even parity. a parity checker in the receiver counts the number of logic 1s in each byte. the parity checker generates an error signal if it finds a byte with an incorrect number of logic 1s. pc ? see ? program counter (pc). ? peripheral ? a circuit not under direct cpu control. phase-locked loop (pll) ? a oscillator circuit in which the frequency of the oscillator is synchronized to a reference signal. pll ? see "phase-locked loop (pll)." pointer ? pointer register. an index register is sometimes called a pointer register because its contents are used in the calculation of the address of an operand, and therefore points to the operand. polarity ? the two opposite logic levels, logic 1 and logic 0, which correspond to two different voltage levels, v dd and v ss . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
glossary technical data mc68hc11p2 ? rev 1.0 glossary port ? a set of wires for communicating with off-chip devices. prescaler ? a circuit that generates an output signal related to the input signal by a fractional scale factor such as 1/2, 1/8, 1/10 etc. program ? a set of computer instructions that cause a computer to perform a desired operation or operations. program counter (pc) ? a 16-bit register in the cpu08. the pc register holds the address of the next instruction or operand that the cpu will use. pull ? an instruction that copies into the accumulator the contents of a stack ram location. the stack ram address is in the stack pointer. pullup ? a transistor in the output of a logic gate that connects the output to the logic 1 voltage of the power supply. pulse-width ? the amount of time a signal is on as opposed to being in its off state. pulse-width modulation (pwm) ? controlled variation (modulation) of the pulse width of a signal with a constant frequency. push ? an instruction that copies the contents of the accumulator to the stack ram. the stack ram address is in the stack pointer. pwm period ? the time required for one complete cycle of a pwm waveform. ram ? random access memory. all ram locations can be read or written by the cpu. the contents of a ram memory location remain valid until the cpu writes a different value or until power is turned off. rc circuit ? a circuit consisting of capacitors and resistors having a defined time constant. read ? to copy the contents of a memory location to the accumulator. register ? a circuit that stores a group of bits. reserved memory location ? a memory location that is used only in special factory test modes. writing to a reserved location has no effect. reading a reserved location returns an unpredictable value. reset ? to force a device to a known condition. rom ? read-only memory. a type of memory that can be read but cannot be changed (written). the contents of rom must be specified before manufacturing the mcu. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
glossary mc68hc11p2 ? rev 1.0 technical data glossary serial communications interface module (sci) ? a module in the m68hc08 family that supports asynchronous communication. serial peripheral interface module (spi) ? a module in the m68hc08 family that supports synchronous communication. set ? to change a bit from logic 0 to logic 1; opposite of clear. shift register ? a chain of circuits that can retain the logic levels (logic 1 or logic 0) written to them and that can shift the logic levels to the right or left through adjacent circuits in the chain. signed ? a binary number notation that accommodates both positive and negative numbers. the most significant bit is used to indicate whether the number is positive or negative, normally logic 0 for positive and logic 1 for negative. the other seven bits indicate the magnitude of the number. software ? instructions and data that control the operation of a microcontroller. software interrupt (swi) ? an instruction that causes an interrupt and its associated vector fetch. spi ? see "serial peripheral interface module (spi)." stack ? a portion of ram reserved for storage of cpu register contents and subroutine return addresses. stack pointer (sp) ? a 16-bit register in the cpu08 containing the address of the next available storage location on the stack. start bit ? a bit that signals the beginning of an asynchronous serial transmission. status bit ? a register bit that indicates the condition of a device. stop bit ? a bit that signals the end of an asynchronous serial transmission. subroutine ? a sequence of instructions to be used more than once in the course of a program. the last instruction in a subroutine is a return from subroutine (rts) instruction. at each place in the main program where the subroutine instructions are needed, a jump or branch to subroutine (jsr or bsr) instruction is used to call the subroutine. the cpu leaves the flow of the main program to execute the instructions in the subroutine. when the rts instruction is executed, the cpu returns to the main program where it left off. synchronous ? refers to logic circuits and operations that are synchronized by a common reference signal. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
glossary technical data mc68hc11p2 ? rev 1.0 glossary timer interface module (tim) ? a module used to relate events in a system to a point in time. timer ? a module used to relate events in a system to a point in time. toggle ? to change the state of an output from a logic 0 to a logic 1 or from a logic 1 to a logic 0. tracking mode ? mode of low-jitter pll operation during which the pll is locked on a frequency. also see "acquisition mode." two ? s complement ? a means of performing binary subtraction using addition techniques. the most significant bit of a two ? s complement number indicates the sign of the number (1 indicates negative). the two ? s complement negative of a number is obtained by inverting each bit in the number and then adding 1 to the result. unbuffered ? utilizes only one register for data; new data overwrites current data. unimplemented memory location ? a memory location that is not used. writing to an unimplemented location has no effect. reading an unimplemented location returns an unpredictable value. executing an opcode at an unimplemented location causes an illegal address reset. v ? the overflow bit in the condition code register of the cpu08. the cpu08 sets the v bit when a two's complement overflow occurs. the signed branch instructions bgt, bge, ble, and blt use the overflow bit. variable ? a value that changes during the course of program execution. vco ? see "voltage-controlled oscillator." vector ? a memory location that contains the address of the beginning of a subroutine written to service an interrupt or reset. voltage-controlled oscillator (vco) ? a circuit that produces an oscillating output signal of a frequency that is controlled by a dc voltage applied to a control input. waveform ? a graphical representation in which the amplitude of a wave is plotted against time. wired-or ? connection of circuit outputs so that if any output is high, the connection point is high. word ? a set of two bytes (16 bits). write ? the transfer of a byte of data from the cpu to a memory location. x ? the lower byte of the index register (h:x) in the cpu08. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc11p2 ? rev 1.0 technical data revision history technical data ? mc68hc11p2 revision history 15.4 major changes between revision 1.0 and revision 0.0 the following table lists the major changes between the current revision of the mc68hc11p2 technical data book, rev 1.0, and the previous revision, rev 0.0. section affected page number description of change general description 19 sci2 pins txd2 and rxd2 corrected to ph7 and ph6 sci3 pins txd3 and rxd3 corrected to ph5 and ph4 pin descriptions 35 22 parallel input/output 82 serial communications interface (sci) 104 motorola interconnect bus (mi bus) 110 mechanical data 248 electrical specifications 246 min and max columns added to eprom characteristics f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
revision history technical data mc68hc11p2 ? rev 1.0 revision history f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68hc11p2/d f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .


▲Up To Search▲   

 
Price & Availability of MC68HC11P0CFN3

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X